Module: Jat::Plugins::BaseActiverecordPreloads::ActiverecordArray::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#fit?(objects) ⇒ Boolean

Returns:

  • (Boolean)


72
73
74
75
76
# File 'lib/jat/plugins/base/base_activerecord_preloads/lib/preloader.rb', line 72

def fit?(objects)
  objects.is_a?(Array) &&
    ActiverecordObject.fit?(objects.first) &&
    same_kind?(objects)
end

#preload(objects, preloads) ⇒ Object



78
79
80
81
# File 'lib/jat/plugins/base/base_activerecord_preloads/lib/preloader.rb', line 78

def preload(objects, preloads)
  Loader.call(objects, preloads)
  objects
end