lib/mongoid/changeable.rb
# Creates the dirty change previous value accessors.
#
# @example Create the accessor.
#   Model.create_dirty_previous_value_accessor("name", "alias")
#
# @param [ String ] name The attribute name.
# @param [ String ] meth The name of the accessor.
Creates the dirty change previous value accessors.
Creates the dirty change previous value accessors .
def create_dirty_previous_value_accessor(name, meth)
        generated_methods.module_eval do
          re_define_method("#{meth}_was") do
            attribute_was(name)
          end
          re_define_method("#{meth}_previously_was") do
            attribute_previously_was(name)
          end
        end
      end
def create_dirty_previous_value_accessor ( name , meth ) generated_methods . module_eval do re_define_method ( "#{meth}_was" ) do attribute_was ( name ) end re_define_method ( "#{meth}_previously_was" ) do attribute_previously_was ( name ) end end end
Creates the dirty change previous value accessors.
Creates the dirty change previous value accessors .
name
<not_specific>
meth
<not_specific>
<not_specific>
meth The name of the accessor.
meth The name of the accessor .
example
Create the accessor. Model.create_dirty_previous_value_accessor("name", "alias")
Create the accessor . Model . create_dirty_previous_value_accessor ( " name " " alias " )