From 21c75e545a798b75d3ad1eaceea567e725ee655a Mon Sep 17 00:00:00 2001 From: Michael Koziarski <michael@koziarski.com> Date: Mon, 18 Feb 2008 04:49:56 +0000 Subject: Ensure nested preloading works when associations return nil. Closes #11145 [GMFlash] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8894 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/cases/associations/eager_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 810336684c..1ea101f3c9 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -76,6 +76,12 @@ class EagerAssociationTest < ActiveRecord::TestCase assert_nil Post.find(posts(:authorless).id, :include => :author).author end + def test_nested_loading_with_no_associations + assert_nothing_raised do + Post.find(posts(:authorless).id, :include => {:author => :author_addresss}) + end + end + def test_eager_association_loading_with_belongs_to_and_foreign_keys pets = Pet.find(:all, :include => :owner) assert_equal 3, pets.length -- cgit v1.2.3