ActiveModel::Dirty

module ActiveModel::Dirty

Included modules:
ActiveModel::AttributeMethods

Active Model Dirty

Provides a way to track changes in your object in the same way as Active Record does.

The requirements for implementing ActiveModel::Dirty are:

  • include ActiveModel::Dirty in your object.

  • Call define_attribute_methods passing each method you want to track.

  • Call [attr_name]_will_change! before each change to the tracked attribute.

  • Call changes_applied after the changes are persisted.

  • Call clear_c