Changeset 8896
- Timestamp:
- 02/19/08 02:56:05 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/lib/active_record/association_preload.rb
r8894 r8896 35 35 raise ConfigurationError, "Association named '#{ association }' was not found; perhaps you misspelled it?" unless reflection 36 36 37 send(:"preload_#{reflection.macro}_association", records, reflection, preload_options) 37 # Not all records have the same class, so group then preload. 38 records.group_by(&:class).each do |klass, records| 39 reflection = klass.reflections[association] 40 send("preload_#{reflection.macro}_association", records, reflection, preload_options) 41 end 38 42 end 39 43