module ActiveModel::Dirty

def changed

person.changed # => ["name"]
person.name = 'bob'
person.changed # => []

Returns an array with the name of the attributes with unsaved changes.
def changed
  mutations_from_database.changed_attribute_names
end