DEV Community

Discussion on: Tracking Rails changed attributes

Collapse
 
arvindvyas profile image
Arvind

class User < ApplicationRecord
end

user = User.first
user.update(address: "new address")
user.address_changed? #returns true if user address has changed

user.address_change

I don't think so this will work, this only work before update not after an update.