aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2016-07-25 00:15:32 +0900
committerRyuta Kamizono <kamipo@gmail.com>2016-07-28 13:54:46 +0900
commitfe48c97e26e68fb32c5980416f8e3a1f4c57a479 (patch)
tree14cfd7a7a96ee6c0325460993bb7913026b36cdd /activerecord/test
parent56527bb737eb5e1d5531cafe99ce91d025565ead (diff)
downloadrails-fe48c97e26e68fb32c5980416f8e3a1f4c57a479.tar.gz
rails-fe48c97e26e68fb32c5980416f8e3a1f4c57a479.tar.bz2
rails-fe48c97e26e68fb32c5980416f8e3a1f4c57a479.zip
`FinderMethods` uses `records` (`load_target`) when `loaded?` is true
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations_test.rb b/activerecord/test/cases/associations_test.rb
index 01a058918a..7412d48fe8 100644
--- a/activerecord/test/cases/associations_test.rb
+++ b/activerecord/test/cases/associations_test.rb
@@ -248,6 +248,8 @@ class AssociationProxyTest < ActiveRecord::TestCase
test "first! works on loaded associations" do
david = authors(:david)
assert_equal david.posts.first, david.posts.reload.first!
+ assert david.posts.loaded?
+ assert_no_queries { david.posts.first! }
end
def test_reset_unloads_target