Class: Serega::SeregaPlugins::ActiverecordPreloads::ActiverecordArray
- Inherits:
-
Object
- Object
- Serega::SeregaPlugins::ActiverecordPreloads::ActiverecordArray
- Defined in:
- lib/serega/plugins/activerecord_preloads/lib/preloader.rb
Overview
Preloader adapter for Array of ActiveRecord objects
Class Method Summary collapse
-
.fit?(object) ⇒ Boolean
Checks object is an array of ActiveRecord::Base objects.
-
.preload(records, preloads) ⇒ Array<ActiveRecord::Base>
Preloads associations to array with ActiveRecord::Base objects.
Class Method Details
.fit?(object) ⇒ Boolean
Checks object is an array of ActiveRecord::Base objects
122 123 124 125 126 |
# File 'lib/serega/plugins/activerecord_preloads/lib/preloader.rb', line 122 def fit?(object) object.is_a?(Array) && ActiverecordObject.fit?(object.first) && same_kind?(object) end |