• P
    Return true if attribute is not changed for update_attribute · 730e99af
    Prathamesh Sonpatki 提交于
    - If the attribute is not changed, then update_attribute does not run
      SQL query, this effectively means that no change was made to the
      attribute.
    - This change was made in https://github.com/rails/rails/commit/0fcd4cf5
      to avoid a SQL call.
    - But the change resulted into `nil` being returned when there was no
      change in the attribute value.
    - This commit corrects the behavior to return true if there is no change
      in attribute value. This is same as previous behavior of Rails 4.2
      plus benefit of no additional SQL call.
    - Fixes #26593.
    730e99af
persistence_test.rb 30.6 KB