ar_transaction_changes icon indicating copy to clipboard operation
ar_transaction_changes copied to clipboard

Discuss about changing the same attribute multiple times

Open lonre opened this issue 7 years ago • 1 comments

If we do something like this:

user = User.create!(name: 'a')

User.transaction do
  user.update_attribute(:name, 'b')
  user.update_attribute(:name, 'a')
end

should we store name as changed attributes?

lonre avatar Mar 02 '17 13:03 lonre

The behaviour should probably be consistent with active record's changed_attributes, which seems to omit changes to attributes that were changed back. So it looks like this is a bug.

dylanahsmith avatar Aug 28 '17 21:08 dylanahsmith

By the looks of the changes in the merged PR, this can be closed.

chriscz avatar Nov 16 '23 01:11 chriscz