Module: ChronoModel::Patches::Preloader::Association

Defined in:
lib/chrono_model/patches.rb

Instance Method Summary collapse

Instance Method Details

#build_scopeObject

Builds the preloader scope taking into account a potential as_of_time set above in Preloader#preload and coming from the user's query invocation.


157
158
159
160
161
162
163
164
165
# File 'lib/chrono_model/patches.rb', line 157

def build_scope
  scope = super

  if preload_scope.respond_to?(:as_of_time)
    scope = scope.as_of(preload_scope.as_of_time)
  end

  return scope
end