Module: ActiveAttr::Dirty::ClassMethods
- Defined in:
- lib/active_attr/dirty.rb
Overview
Class methods for ActiveAttr::Dirty module
Instance Method Summary collapse
-
#attribute!(name, options = {}) ⇒ Object
Overwritten attribute! method.
Instance Method Details
#attribute!(name, options = {}) ⇒ Object
Overwritten attribute! method
17 18 19 20 21 22 23 |
# File 'lib/active_attr/dirty.rb', line 17 def attribute!(name, ={}) super(name, ) define_method("#{name}=") do |value| send("#{name}_will_change!") unless value == read_attribute(name) super(value) end end |