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/lib | |
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/lib')
-rw-r--r-- | activerecord/lib/active_record/persistence.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index 978fb27cab..65248f3a32 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -252,7 +252,8 @@ module ActiveRecord name = name.to_s verify_readonly_attribute(name) public_send("#{name}=", value) - save(validate: false) if changed? + + changed? ? save(validate: false) : true end # Updates the attributes of the model from the passed-in hash and saves the |