Module: Jat::Plugins::BaseActiverecordPreloads::ActiverecordObject::ClassMethods

Included in:
Jat::Plugins::BaseActiverecordPreloads::ActiverecordObject
Defined in:
lib/jat/plugins/base/base_activerecord_preloads/lib/preloader.rb

Instance Method Summary collapse

Instance Method Details

#fit?(object) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/jat/plugins/base/base_activerecord_preloads/lib/preloader.rb', line 37

def fit?(object)
  object.is_a?(ActiveRecord::Base)
end

#preload(object, preloads) ⇒ Object



41
42
43
44
# File 'lib/jat/plugins/base/base_activerecord_preloads/lib/preloader.rb', line 41

def preload(object, preloads)
  Loader.call([object], preloads)
  object
end