diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2016-09-23 09:51:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-23 09:51:39 -0700 |
commit | abe3da9f12710ea85be69b17172bef41220037fc (patch) | |
tree | 3e88ad35bf3ff727259213a8fd9dd7e9f96eebff /activerecord/test | |
parent | 3b0da83c81047c783d1fe730691d367e286fbf1a (diff) | |
parent | 730e99affb5824363599ec25445b9450b6247fde (diff) | |
download | rails-abe3da9f12710ea85be69b17172bef41220037fc.tar.gz rails-abe3da9f12710ea85be69b17172bef41220037fc.tar.bz2 rails-abe3da9f12710ea85be69b17172bef41220037fc.zip |
Merge pull request #26595 from prathamesh-sonpatki/fix-26593
Return true if attribute is not changed for update_attribute
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/persistence_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb index d83360e327..688c3ed2b1 100644 --- a/activerecord/test/cases/persistence_test.rb +++ b/activerecord/test/cases/persistence_test.rb @@ -391,14 +391,14 @@ class PersistenceTest < ActiveRecord::TestCase end topic = klass.create(title: "Another New Topic") assert_queries(0) do - topic.update_attribute(:title, "Another New Topic") + assert topic.update_attribute(:title, "Another New Topic") end end def test_update_does_not_run_sql_if_record_has_not_changed topic = Topic.create(title: "Another New Topic") - assert_queries(0) { topic.update(title: "Another New Topic") } - assert_queries(0) { topic.update_attributes(title: "Another New Topic") } + assert_queries(0) { assert topic.update(title: "Another New Topic") } + assert_queries(0) { assert topic.update_attributes(title: "Another New Topic") } end def test_delete |