lib/chrono_model/patches/relation.rb in chrono_model-2.0.0 vs lib/chrono_model/patches/relation.rb in chrono_model-3.0.1
- old
+ new
@@ -3,20 +3,18 @@
module ChronoModel
module Patches
module Relation
include ChronoModel::Patches::AsOfTimeHolder
- if ActiveRecord::Associations::Preloader.instance_methods.include?(:call)
- def preload_associations(records) # :nodoc:
- preload = preload_values
- preload += includes_values unless eager_loading?
- scope = StrictLoadingScope if strict_loading_value
+ def preload_associations(records) # :nodoc:
+ preload = preload_values
+ preload += includes_values unless eager_loading?
+ scope = StrictLoadingScope if strict_loading_value
- preload.each do |associations|
- ActiveRecord::Associations::Preloader.new(
- records: records, associations: associations, scope: scope, model: model, as_of_time: as_of_time
- ).call
- end
+ preload.each do |associations|
+ ActiveRecord::Associations::Preloader.new(
+ records: records, associations: associations, scope: scope, model: model, as_of_time: as_of_time
+ ).call
end
end
def empty_scope?
return super unless @_as_of_time