Class: ActiveRecord::Associations::Preloader::AlreadyLoaded
- Inherits:
-
Object
- Object
- ActiveRecord::Associations::Preloader::AlreadyLoaded
- Defined in:
- lib/active_record/associations/preloader.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(klass, owners, reflection, preload_scope) ⇒ AlreadyLoaded
constructor
A new instance of AlreadyLoaded.
- #preloaded_records ⇒ Object
- #run(preloader) ⇒ Object
Constructor Details
#initialize(klass, owners, reflection, preload_scope) ⇒ AlreadyLoaded
Returns a new instance of AlreadyLoaded.
161 162 163 164 |
# File 'lib/active_record/associations/preloader.rb', line 161 def initialize(klass, owners, reflection, preload_scope) @owners = owners @reflection = reflection end |
Instance Method Details
#preloaded_records ⇒ Object
168 169 170 |
# File 'lib/active_record/associations/preloader.rb', line 168 def preloaded_records owners.flat_map { |owner| owner.association(reflection.name).target } end |
#run(preloader) ⇒ Object
166 |
# File 'lib/active_record/associations/preloader.rb', line 166 def run(preloader); end |