From d42909401f29feadec91dca9c20739e4af49e288 Mon Sep 17 00:00:00 2001 From: rhymes Date: Tue, 17 Aug 2021 18:54:03 +0200 Subject: [PATCH] Bullet: rename deprecated add_whitelist to add_safelist (#14521) --- config/environments/development.rb | 10 +++++----- config/environments/test.rb | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 7a70604cd..2c75b9349 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -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: - 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? diff --git a/config/environments/test.rb b/config/environments/test.rb index e6da57661..a69598f96 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -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: - 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