module Mobility::Plugins::ActiveRecord::Dirty
Dirty
tracking for AR models. See {Mobility::Plugins::ActiveModel::Dirty} for details on usage.
In addition to methods added by {Mobility::Plugins::ActiveModel::Dirty}, the AR::Dirty plugin adds support for the following persistence-specific methods (for a model with a translated attribute title
):
-
saved_change_to_title?
-
saved_change_to_title
-
title_before_last_save
-
will_save_change_to_title?
-
title_change_to_be_saved
-
title_in_database
The following methods are also patched to include translated attribute changes:
-
saved_changes
-
has_changes_to_save?
-
changes_to_save
-
changed_attribute_names_to_save
-
attributes_in_database
In addition, the following ActiveModel
attribute handler methods are also patched to work with translated attributes:
-
saved_change_to_attribute?
-
saved_change_to_attribute
-
attribute_before_last_save
-
will_save_change_to_attribute?
-
attribute_change_to_be_saved
-
attribute_in_database
(When using these methods, you must pass the attribute name along with its locale suffix, so title_en
, title_pt_br
, etc.)
Constants
- BackendMethods
- HandlerMethods
Module which defines generic
ActiveRecord::Dirty
handler methods likeattribute_before_last_save
that are patched to work with translated attributes.
Private Instance Methods
# File lib/mobility/plugins/active_record/dirty.rb, line 62 def dirty_handler_methods HandlerMethods end