lib/gizzard/base.rb in gizzard-0.9.1 vs lib/gizzard/base.rb in gizzard-0.10.0

- old
+ new

@@ -5,14 +5,10 @@ class_methods do def preload_associations(records:, associations:, scope: nil) records = Array(records) return if records.empty? - if Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new(7) - ActiveRecord::Associations::Preloader.new(records: records, associations: associations, scope: scope).call - else - ActiveRecord::Associations::Preloader.new.preload(records, associations, scope) - end + ActiveRecord::Associations::Preloader.new(records: records, associations: associations, scope: scope).call end def delete_all_by_id(batch_size: 1000) ids = pluck(:id) ids.sort!