Module: ActiveAttr::Dirty
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActiveModel::Dirty
- Included in:
- Syncano::ActiveRecord::Base
- Defined in:
- lib/active_attr/dirty.rb
Overview
Overwritting ActiveAttr::Dirty module
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#initialize(attributes = nil, options = {}) ⇒ Object
Overwritten constructor.
-
#save ⇒ Object
Overwritten save method.
Instance Method Details
#initialize(attributes = nil, options = {}) ⇒ Object
Overwritten constructor
29 30 31 32 |
# File 'lib/active_attr/dirty.rb', line 29 def initialize(attributes = nil, = {}) super(attributes, ) (@changed_attributes || {}).clear unless new_record? end |
#save ⇒ Object
Overwritten save method
35 36 37 38 |
# File 'lib/active_attr/dirty.rb', line 35 def save @previously_changed = changes @changed_attributes.clear end |