diff options
author | Amparo Luna + Guillermo Iguaran <amparo.m.luna@gmail.com+guilleiguaran@gmail.com> | 2013-01-02 11:46:58 -0500 |
---|---|---|
committer | Amparo Luna + Guillermo Iguaran <amparo.m.luna@gmail.com+guilleiguaran@gmail.com> | 2013-01-03 11:51:21 -0500 |
commit | 1f3a1fedf951dbc4b72d178e2a649c4afd2f1566 (patch) | |
tree | 0bf671d26800e9e95128bb71672e6c52c248a488 /activerecord/test/cases/associations/eager_test.rb | |
parent | 08db381d15ce37c54bd0f23a6a63eaeda1c1d6f3 (diff) | |
download | rails-1f3a1fedf951dbc4b72d178e2a649c4afd2f1566.tar.gz rails-1f3a1fedf951dbc4b72d178e2a649c4afd2f1566.tar.bz2 rails-1f3a1fedf951dbc4b72d178e2a649c4afd2f1566.zip |
Rename update_attributes method to update, keep update_attributes as an alias
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 |