Module: Mongoid::Attributes::ClassMethods
- Defined in:
- lib/mongoid/attributes.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#alias_attribute(name, original) ⇒ Object
Alias the provided name to the original field.
Instance Method Details
#alias_attribute(name, original) ⇒ Object
Alias the provided name to the original field. This will provide an aliased getter, setter, existance check, and all dirty attribute methods.
224 225 226 227 228 229 230 231 |
# File 'lib/mongoid/attributes.rb', line 224 def alias_attribute(name, original) class_eval <<-RUBY alias :#{name} :#{original} alias :#{name}= :#{original}= alias :#{name}? :#{original}? RUBY super end |