Bullet: rename deprecated add_whitelist to add_safelist (#14521)

This commit is contained in:
rhymes 2021-08-17 18:54:03 +02:00 committed by GitHub
parent 2a3eac4c09
commit d42909401f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 14 deletions

View file

@ -123,14 +123,14 @@ Rails.application.configure do
Bullet.console = true
Bullet.rails_logger = true
Bullet.add_whitelist(type: :unused_eager_loading, class_name: "ApiSecret", association: :user)
Bullet.add_safelist(type: :unused_eager_loading, class_name: "ApiSecret", association: :user)
# acts-as-taggable-on has super weird eager loading problems: <https://github.com/mbleigh/acts-as-taggable-on/issues/91>
Bullet.add_whitelist(type: :n_plus_one_query, class_name: "ActsAsTaggableOn::Tagging", association: :tag)
Bullet.add_safelist(type: :n_plus_one_query, class_name: "ActsAsTaggableOn::Tagging", association: :tag)
# Supress incorrect warnings from Bullet due to included columns: https://github.com/flyerhzm/bullet/issues/147
Bullet.add_whitelist(type: :unused_eager_loading, class_name: "Article", association: :top_comments)
Bullet.add_whitelist(type: :unused_eager_loading, class_name: "Comment", association: :user)
Bullet.add_safelist(type: :unused_eager_loading, class_name: "Article", association: :top_comments)
Bullet.add_safelist(type: :unused_eager_loading, class_name: "Comment", association: :user)
# NOTE: @citizen428 Temporarily ignoring this while working out user - profile relationship
Bullet.add_whitelist(type: :n_plus_one_query, class_name: "User", association: :profile)
Bullet.add_safelist(type: :n_plus_one_query, class_name: "User", association: :profile)
# Check if there are any data update scripts to run during startup
if %w[Console Server DBConsole].any? { |const| Rails.const_defined?(const) } && DataUpdateScript.scripts_to_run?

View file

@ -74,19 +74,19 @@ Rails.application.configure do
Bullet.enable = true
Bullet.raise = true
Bullet.add_whitelist(type: :unused_eager_loading, class_name: "ApiSecret", association: :user)
Bullet.add_safelist(type: :unused_eager_loading, class_name: "ApiSecret", association: :user)
# acts-as-taggable-on has super weird eager loading problems: <https://github.com/mbleigh/acts-as-taggable-on/issues/91>
Bullet.add_whitelist(type: :n_plus_one_query, class_name: "ActsAsTaggableOn::Tagging", association: :tag)
Bullet.add_safelist(type: :n_plus_one_query, class_name: "ActsAsTaggableOn::Tagging", association: :tag)
# Supress incorrect warnings from Bullet due to included columns: https://github.com/flyerhzm/bullet/issues/147
Bullet.add_whitelist(type: :unused_eager_loading, class_name: "Article", association: :top_comments)
Bullet.add_whitelist(type: :unused_eager_loading, class_name: "Comment", association: :user)
Bullet.add_safelist(type: :unused_eager_loading, class_name: "Article", association: :top_comments)
Bullet.add_safelist(type: :unused_eager_loading, class_name: "Comment", association: :user)
# NOTE: @citizen428 Temporarily ignoring this while working out user - profile relationship
Bullet.add_whitelist(type: :n_plus_one_query, class_name: "User", association: :profile)
Bullet.add_whitelist(type: :n_plus_one_query, class_name: "User", association: :setting)
Bullet.add_whitelist(type: :n_plus_one_query, class_name: "User", association: :notification_setting)
Bullet.add_safelist(type: :n_plus_one_query, class_name: "User", association: :profile)
Bullet.add_safelist(type: :n_plus_one_query, class_name: "User", association: :setting)
Bullet.add_safelist(type: :n_plus_one_query, class_name: "User", association: :notification_setting)
# @mstruve: These occur during setting updates, not sure how since we are only dealing with single setting records
Bullet.add_whitelist(type: :n_plus_one_query, class_name: "Users::Setting", association: :user)
Bullet.add_whitelist(type: :n_plus_one_query, class_name: "Users::NotificationSetting", association: :user)
Bullet.add_safelist(type: :n_plus_one_query, class_name: "Users::Setting", association: :user)
Bullet.add_safelist(type: :n_plus_one_query, class_name: "Users::NotificationSetting", association: :user)
end
end
# rubocop:enable Metrics/BlockLength