Autofix Rubocop remaining Layout rules (#23679)
This commit is contained in:
		@@ -4,12 +4,12 @@ class MigrateNotificationsType < ActiveRecord::Migration[5.2]
 | 
			
		||||
  disable_ddl_transaction!
 | 
			
		||||
 | 
			
		||||
  TYPES_TO_MIGRATE = {
 | 
			
		||||
    'Mention'       => :mention,
 | 
			
		||||
    'Status'        => :reblog,
 | 
			
		||||
    'Follow'        => :follow,
 | 
			
		||||
    'Mention' => :mention,
 | 
			
		||||
    'Status' => :reblog,
 | 
			
		||||
    'Follow' => :follow,
 | 
			
		||||
    'FollowRequest' => :follow_request,
 | 
			
		||||
    'Favourite'     => :favourite,
 | 
			
		||||
    'Poll'          => :poll,
 | 
			
		||||
    'Favourite' => :favourite,
 | 
			
		||||
    'Poll' => :poll,
 | 
			
		||||
  }.freeze
 | 
			
		||||
 | 
			
		||||
  def up
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,5 @@
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
 | 
			
		||||
 | 
			
		||||
class RemoveWholeWordFromCustomFilters < ActiveRecord::Migration[6.1]
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,5 @@
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
 | 
			
		||||
 | 
			
		||||
class RemoveIrreversibleFromCustomFilters < ActiveRecord::Migration[6.1]
 | 
			
		||||
 
 | 
			
		||||
@@ -79,11 +79,13 @@ class BackfillAdminActionLogs < ActiveRecord::Migration[6.1]
 | 
			
		||||
    safety_assured do
 | 
			
		||||
      AdminActionLog.includes(:account).where(target_type: 'Account', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.account.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.account.acct)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(user: :account).where(target_type: 'User', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.user.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.user.account.acct)
 | 
			
		||||
        log.update_attribute('route_param', log.user.account_id)
 | 
			
		||||
      end
 | 
			
		||||
@@ -92,57 +94,68 @@ class BackfillAdminActionLogs < ActiveRecord::Migration[6.1]
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:domain_block).where(target_type: 'DomainBlock').find_each do |log|
 | 
			
		||||
        next if log.domain_block.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.domain_block.domain)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:domain_allow).where(target_type: 'DomainAllow').find_each do |log|
 | 
			
		||||
        next if log.domain_allow.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.domain_allow.domain)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:email_domain_block).where(target_type: 'EmailDomainBlock').find_each do |log|
 | 
			
		||||
        next if log.email_domain_block.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.email_domain_block.domain)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:unavailable_domain).where(target_type: 'UnavailableDomain').find_each do |log|
 | 
			
		||||
        next if log.unavailable_domain.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.unavailable_domain.domain)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(status: :account).where(target_type: 'Status', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.status.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.status.account.acct)
 | 
			
		||||
        log.update_attribute('permalink', log.status.uri)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(account_warning: :account).where(target_type: 'AccountWarning', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.account_warning.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.account_warning.account.acct)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:announcement).where(target_type: 'Announcement', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.announcement.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.announcement.text)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:ip_block).where(target_type: 'IpBlock', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.ip_block.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', "#{log.ip_block.ip}/#{log.ip_block.ip.prefix}")
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:custom_emoji).where(target_type: 'CustomEmoji', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.custom_emoji.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.custom_emoji.shortcode)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:canonical_email_block).where(target_type: 'CanonicalEmailBlock', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.canonical_email_block.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.canonical_email_block.canonical_email_hash)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(appeal: :account).where(target_type: 'Appeal', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.appeal.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.appeal.account.acct)
 | 
			
		||||
        log.update_attribute('route_param', log.appeal.account_warning_id)
 | 
			
		||||
      end
 | 
			
		||||
 
 | 
			
		||||
@@ -79,11 +79,13 @@ class BackfillAdminActionLogsAgain < ActiveRecord::Migration[6.1]
 | 
			
		||||
    safety_assured do
 | 
			
		||||
      AdminActionLog.includes(:account).where(target_type: 'Account', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.account.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.account.acct)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(user: :account).where(target_type: 'User', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.user.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.user.account.acct)
 | 
			
		||||
        log.update_attribute('route_param', log.user.account_id)
 | 
			
		||||
      end
 | 
			
		||||
@@ -92,57 +94,68 @@ class BackfillAdminActionLogsAgain < ActiveRecord::Migration[6.1]
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:domain_block).where(target_type: 'DomainBlock').find_each do |log|
 | 
			
		||||
        next if log.domain_block.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.domain_block.domain)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:domain_allow).where(target_type: 'DomainAllow').find_each do |log|
 | 
			
		||||
        next if log.domain_allow.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.domain_allow.domain)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:email_domain_block).where(target_type: 'EmailDomainBlock').find_each do |log|
 | 
			
		||||
        next if log.email_domain_block.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.email_domain_block.domain)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:unavailable_domain).where(target_type: 'UnavailableDomain').find_each do |log|
 | 
			
		||||
        next if log.unavailable_domain.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.unavailable_domain.domain)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(status: :account).where(target_type: 'Status', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.status.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.status.account.acct)
 | 
			
		||||
        log.update_attribute('permalink', log.status.uri)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(account_warning: :account).where(target_type: 'AccountWarning', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.account_warning.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.account_warning.account.acct)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:announcement).where(target_type: 'Announcement', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.announcement.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.announcement.text)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:ip_block).where(target_type: 'IpBlock', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.ip_block.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', "#{log.ip_block.ip}/#{log.ip_block.ip.prefix}")
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:custom_emoji).where(target_type: 'CustomEmoji', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.custom_emoji.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.custom_emoji.shortcode)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(:canonical_email_block).where(target_type: 'CanonicalEmailBlock', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.canonical_email_block.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.canonical_email_block.canonical_email_hash)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      AdminActionLog.includes(appeal: :account).where(target_type: 'Appeal', human_identifier: nil).find_each do |log|
 | 
			
		||||
        next if log.appeal.nil?
 | 
			
		||||
 | 
			
		||||
        log.update_attribute('human_identifier', log.appeal.account.acct)
 | 
			
		||||
        log.update_attribute('route_param', log.appeal.account_warning_id)
 | 
			
		||||
      end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user