diff --git a/spec/ransack/adapters/active_record/base_spec.rb b/spec/ransack/adapters/active_record/base_spec.rb index afba4e4d..006cbf98 100644 --- a/spec/ransack/adapters/active_record/base_spec.rb +++ b/spec/ransack/adapters/active_record/base_spec.rb @@ -314,7 +314,11 @@ def self.sane_adapter? end it 'should function correctly with a multi-parameter attribute' do - ::ActiveRecord::Base.default_timezone = :utc + if ::ActiveRecord::VERSION::MAJOR >= 7 + ::ActiveRecord.default_timezone = :utc + else + ::ActiveRecord::Base.default_timezone = :utc + end Time.zone = 'UTC' date = Date.current