aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-02-18 04:49:56 +0000
committerMichael Koziarski <michael@koziarski.com>2008-02-18 04:49:56 +0000
commit21c75e545a798b75d3ad1eaceea567e725ee655a (patch)
treefc50b85aa2e64d10e3ec9d48b7cfeaea9ea74914 /activerecord/test/cases/associations
parentcae1d960d294e4e910895f4a25b6e5a59e91d492 (diff)
downloadrails-21c75e545a798b75d3ad1eaceea567e725ee655a.tar.gz
rails-21c75e545a798b75d3ad1eaceea567e725ee655a.tar.bz2
rails-21c75e545a798b75d3ad1eaceea567e725ee655a.zip
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
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r--activerecord/test/cases/associations/eager_test.rb6
1 files changed, 6 insertions, 0 deletions
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