From 7390bd4b66378f077cea5c4b13fd42548aa01788 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 9 Jan 2025 12:23:38 +0000 Subject: [PATCH] Remove pre Rails 7.1 conditionals --- config/environments/development.rb | 12 +++--------- lib/no_constraint_disabling.rb | 6 +----- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 14a53a5f7f..0fff5f0a6e 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -77,15 +77,9 @@ # to make Rails upgrades easier. # ---------------------------------------------------------------- - if Rails.version < '7.1.0' - config.action_mailer.preview_path = Rails.root.join( - 'spec', 'mailers', 'previews' - ) - else - config.action_mailer.preview_paths = [ - Rails.root.join('spec', 'mailers', 'previews') - ] - end + config.action_mailer.preview_paths = [ + Rails.root.join('spec', 'mailers', 'previews') + ] # Set LOG_LEVEL in the environment to a valid log level to temporarily run the # application with a non-default setting. diff --git a/lib/no_constraint_disabling.rb b/lib/no_constraint_disabling.rb index fdebebfa4b..c8132524a3 100644 --- a/lib/no_constraint_disabling.rb +++ b/lib/no_constraint_disabling.rb @@ -26,11 +26,7 @@ module ActiveRecord class FixtureSet def self.create_fixtures(fixtures_directory, fixture_set_names, class_names = {}, config = ActiveRecord::Base) fixture_set_names = Array(fixture_set_names).map(&:to_s) - if Rails.version < '7.1.0' - class_names = ClassCache.new class_names, config - else - class_names.stringify_keys! - end + class_names.stringify_keys! # FIXME: Apparently JK uses this. connection = block_given? ? yield : ActiveRecord::Base.connection