Changeset 8894
- Timestamp:
- 02/18/08 04:49:56 (2 years ago)
- Files:
-
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activerecord/lib/active_record/association_preload.rb (modified) (1 diff)
- trunk/activerecord/test/cases/associations/eager_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/CHANGELOG
r8890 r8894 1 1 *SVN* 2 3 * Ensure association preloading doesn't break when an association returns nil. ##11145 [GMFlash] 2 4 3 5 * Make dynamic finders respect the :include on HasManyThrough associations. #10998. [cpytel] trunk/activerecord/lib/active_record/association_preload.rb
r8762 r8894 22 22 reflection = reflections[parent] 23 23 parents = records.map {|record| record.send(reflection.name)}.flatten 24 unless parents.empty? 24 unless parents.empty? || parents.first.nil? 25 25 parents.first.class.preload_associations(parents, child) 26 26 end trunk/activerecord/test/cases/associations/eager_test.rb
r8890 r8894 75 75 def test_loading_with_no_associations 76 76 assert_nil Post.find(posts(:authorless).id, :include => :author).author 77 end 78 79 def test_nested_loading_with_no_associations 80 assert_nothing_raised do 81 Post.find(posts(:authorless).id, :include => {:author => :author_addresss}) 82 end 77 83 end 78 84