diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-01-03 09:09:59 -0800 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-01-03 09:09:59 -0800 |
commit | cb2bd4aa619d9329c42aaf6d9f8eacc616ce53f4 (patch) | |
tree | 409db16994e4a96c8ac08a04a0a37dd34df7c2cb /activerecord/test/cases/associations/eager_test.rb | |
parent | b4a23edc106f0c74aaa71fc605b76429064e3436 (diff) | |
parent | d826f14443a8030068324b1fcab8dc0f1fc87c9d (diff) | |
download | rails-cb2bd4aa619d9329c42aaf6d9f8eacc616ce53f4.tar.gz rails-cb2bd4aa619d9329c42aaf6d9f8eacc616ce53f4.tar.bz2 rails-cb2bd4aa619d9329c42aaf6d9f8eacc616ce53f4.zip |
Merge pull request #8705 from amparo-luna/change_update_attributes_to_update
Rename update_attributes method to update
Diffstat (limited to 'activerecord/test/cases/associations/eager_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 94437380a4..ce1da53859 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -212,8 +212,9 @@ class EagerAssociationTest < ActiveRecord::TestCase def test_finding_with_includes_on_null_belongs_to_association_with_same_include_includes_only_once post = posts(:welcome) - post.update_attributes!(:author => nil) - post = assert_queries(1) { Post.all.merge!(:includes => {:author_with_address => :author_address}).find(post.id) } # find the post, then find the author which is null so no query for the author or address + post.update!(author: nil) + post = assert_queries(1) { Post.all.merge!(includes: {author_with_address: :author_address}).find(post.id) } + # find the post, then find the author which is null so no query for the author or address assert_no_queries do assert_equal nil, post.author_with_address end @@ -221,7 +222,7 @@ class EagerAssociationTest < ActiveRecord::TestCase def test_finding_with_includes_on_null_belongs_to_polymorphic_association sponsor = sponsors(:moustache_club_sponsor_for_groucho) - sponsor.update_attributes!(:sponsorable => nil) + sponsor.update!(sponsorable: nil) sponsor = assert_queries(1) { Sponsor.all.merge!(:includes => :sponsorable).find(sponsor.id) } assert_no_queries do assert_equal nil, sponsor.sponsorable |