From 18057d2fb6017df988fadc6496f187c2e6208277 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 17 Aug 2006 23:46:55 +0000 Subject: Cache nil results for :included has_one associations also. Closes #5787. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4783 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/associations_test.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb index cb704ffd2e..6e93b7430c 100755 --- a/activerecord/test/associations_test.rb +++ b/activerecord/test/associations_test.rb @@ -99,6 +99,9 @@ class HasOneAssociationsTest < Test::Unit::TestCase def test_has_one_cache_nils assert_nil companies(:another_firm).account assert_queries(0) { companies(:another_firm).account } + + firms = Firm.find(:all, :include => :account) + assert_queries(0) { firms.each(&:account) } end def test_proxy_assignment -- cgit v1.2.3