Opt out of `Rails/SkipsModelValidations` cop in db/migrate (#28371)

shrike
Matt Jankowski 2023-12-15 09:38:12 -05:00 committed by GitHub
parent e5717c9bc6
commit 3e336fe706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 17 deletions

View File

@ -105,6 +105,10 @@ Rails/Exit:
- 'config/boot.rb' - 'config/boot.rb'
- 'lib/mastodon/cli/*.rb' - 'lib/mastodon/cli/*.rb'
Rails/SkipsModelValidations:
Exclude:
- 'db/*migrate/**/*'
# Reason: Some single letter camel case files shouldn't be split # Reason: Some single letter camel case files shouldn't be split
# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecfilepath # https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecfilepath
RSpec/FilePath: RSpec/FilePath:

View File

@ -181,22 +181,6 @@ Rails/SkipsModelValidations:
- 'app/workers/move_worker.rb' - 'app/workers/move_worker.rb'
- 'app/workers/scheduler/ip_cleanup_scheduler.rb' - 'app/workers/scheduler/ip_cleanup_scheduler.rb'
- 'app/workers/scheduler/scheduled_statuses_scheduler.rb' - 'app/workers/scheduler/scheduled_statuses_scheduler.rb'
- 'db/migrate/20161203164520_add_from_account_id_to_notifications.rb'
- 'db/migrate/20170105224407_add_shortcode_to_media_attachments.rb'
- 'db/migrate/20170209184350_add_reply_to_statuses.rb'
- 'db/migrate/20170304202101_add_type_to_media_attachments.rb'
- 'db/migrate/20180528141303_fix_accounts_unique_index.rb'
- 'db/migrate/20180609104432_migrate_web_push_subscriptions2.rb'
- 'db/migrate/20181207011115_downcase_custom_emoji_domains.rb'
- 'db/migrate/20190511134027_add_silenced_at_suspended_at_to_accounts.rb'
- 'db/migrate/20191007013357_update_pt_locales.rb'
- 'db/migrate/20220316233212_update_kurdish_locales.rb'
- 'db/post_migrate/20190511152737_remove_suspended_silenced_account_fields.rb'
- 'db/post_migrate/20200917193528_migrate_notifications_type.rb'
- 'db/post_migrate/20201017234926_fill_account_suspension_origin.rb'
- 'db/post_migrate/20220617202502_migrate_roles.rb'
- 'db/post_migrate/20221101190723_backfill_admin_action_logs.rb'
- 'db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb'
- 'lib/mastodon/cli/accounts.rb' - 'lib/mastodon/cli/accounts.rb'
- 'lib/mastodon/cli/maintenance.rb' - 'lib/mastodon/cli/maintenance.rb'
- 'spec/lib/activitypub/activity/follow_spec.rb' - 'spec/lib/activitypub/activity/follow_spec.rb'

View File

@ -80,7 +80,7 @@ class MoveUserSettings < ActiveRecord::Migration[6.1]
end end
end end
user.update_column('settings', Oj.dump(user_settings)) # rubocop:disable Rails/SkipsModelValidations user.update_column('settings', Oj.dump(user_settings))
end end
end end
end end