Class: Serega::SeregaPlugins::ActiverecordPreloads::Loader
- Inherits:
-
Object
- Object
- Serega::SeregaPlugins::ActiverecordPreloads::Loader
- Defined in:
- lib/serega/plugins/activerecord_preloads/lib/preloader.rb
Overview
Associations loader for prepared records
Class Method Summary collapse
-
.call(records, associations) ⇒ void
Preloads associations to records.
Class Method Details
.call(records, associations) ⇒ void
This method returns an undefined value.
Preloads associations to records
50 51 52 53 54 55 56 |
# File 'lib/serega/plugins/activerecord_preloads/lib/preloader.rb', line 50 def self.call(records, associations) if ActiveRecord::VERSION::MAJOR >= 7 ActiveRecord::Associations::Preloader.new(records: records, associations: associations).call else ActiveRecord::Associations::Preloader.new.preload(records, associations) end end |