Method: ActiveModel::Dirty#changed?

Defined in:
activemodel/lib/active_model/dirty.rb

#changed?Boolean

Returns true if any of the attributes has unsaved changes, false otherwise.

person.changed? # => false
person.name = 'bob'
person.changed? # => true

Returns:

  • (Boolean)


286
287
288
# File 'activemodel/lib/active_model/dirty.rb', line 286

def changed?
  mutations_from_database.any_changes?
end