mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
reuse the same preloader object for each association
This commit is contained in:
parent
6e5a2cb951
commit
f34d46ab82
1 changed files with 2 additions and 2 deletions
|
@ -599,9 +599,9 @@ module ActiveRecord
|
|||
|
||||
preload = preload_values
|
||||
preload += includes_values unless eager_loading?
|
||||
preloader = ActiveRecord::Associations::Preloader.new
|
||||
preload.each do |associations|
|
||||
pl = ActiveRecord::Associations::Preloader.new
|
||||
pl.preload @records, associations
|
||||
preloader.preload @records, associations
|
||||
end
|
||||
|
||||
@records.each { |record| record.readonly! } if readonly_value
|
||||
|
|
Loading…
Reference in a new issue