From 5f1a0f550bb9010b98813bf2d465517256340f05 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Fri, 31 Mar 2023 09:07:22 -0400 Subject: [PATCH] Autofix Rubocop Rails/IgnoredColumnsAssignment (#23761) --- .rubocop_todo.yml | 11 ----------- app/models/account.rb | 2 +- app/models/account_stat.rb | 2 +- app/models/admin/action_log.rb | 2 +- app/models/custom_filter.rb | 2 +- app/models/email_domain_block.rb | 2 +- app/models/report.rb | 2 +- app/models/status_edit.rb | 2 +- 8 files changed, 7 insertions(+), 18 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e15cb30f55..2e4801a552 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1431,17 +1431,6 @@ Rails/I18nLocaleTexts: - 'lib/tasks/mastodon.rake' - 'spec/helpers/flashes_helper_spec.rb' -# This cop supports unsafe autocorrection (--autocorrect-all). -Rails/IgnoredColumnsAssignment: - Exclude: - - 'app/models/account.rb' - - 'app/models/account_stat.rb' - - 'app/models/admin/action_log.rb' - - 'app/models/custom_filter.rb' - - 'app/models/email_domain_block.rb' - - 'app/models/report.rb' - - 'app/models/status_edit.rb' - # Configuration parameters: IgnoreScopes, Include. # Include: app/models/**/*.rb Rails/InverseOf: diff --git a/app/models/account.rb b/app/models/account.rb index c4df488789..f49cae901c 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -53,7 +53,7 @@ # class Account < ApplicationRecord - self.ignored_columns = %w( + self.ignored_columns += %w( subscription_expires_at secret remote_url diff --git a/app/models/account_stat.rb b/app/models/account_stat.rb index 834f8ba4c2..0fea7732e9 100644 --- a/app/models/account_stat.rb +++ b/app/models/account_stat.rb @@ -16,7 +16,7 @@ class AccountStat < ApplicationRecord self.locking_column = nil - self.ignored_columns = %w(lock_version) + self.ignored_columns += %w(lock_version) belongs_to :account, inverse_of: :account_stat diff --git a/app/models/admin/action_log.rb b/app/models/admin/action_log.rb index 4fa8008f5c..f2c121d758 100644 --- a/app/models/admin/action_log.rb +++ b/app/models/admin/action_log.rb @@ -17,7 +17,7 @@ # class Admin::ActionLog < ApplicationRecord - self.ignored_columns = %w( + self.ignored_columns += %w( recorded_changes ) diff --git a/app/models/custom_filter.rb b/app/models/custom_filter.rb index d85e196e96..0f4fd78cbf 100644 --- a/app/models/custom_filter.rb +++ b/app/models/custom_filter.rb @@ -15,7 +15,7 @@ # class CustomFilter < ApplicationRecord - self.ignored_columns = %w(whole_word irreversible) + self.ignored_columns += %w(whole_word irreversible) alias_attribute :title, :phrase alias_attribute :filter_action, :action diff --git a/app/models/email_domain_block.rb b/app/models/email_domain_block.rb index 276e7d31a1..3c9be51cab 100644 --- a/app/models/email_domain_block.rb +++ b/app/models/email_domain_block.rb @@ -12,7 +12,7 @@ # class EmailDomainBlock < ApplicationRecord - self.ignored_columns = %w( + self.ignored_columns += %w( ips last_refresh_at ) diff --git a/app/models/report.rb b/app/models/report.rb index a9940459de..c3a0c4c8b2 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -21,7 +21,7 @@ # class Report < ApplicationRecord - self.ignored_columns = %w(action_taken) + self.ignored_columns += %w(action_taken) include Paginable include RateLimitable diff --git a/app/models/status_edit.rb b/app/models/status_edit.rb index 683441bb56..2b3248bb2c 100644 --- a/app/models/status_edit.rb +++ b/app/models/status_edit.rb @@ -20,7 +20,7 @@ class StatusEdit < ApplicationRecord include RateLimitable - self.ignored_columns = %w( + self.ignored_columns += %w( media_attachments_changed )