Module: ActiveRecord::AttributeMethods::Dirty
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActiveModel::Dirty
- Defined in:
- lib/active_record/attribute_methods/dirty.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize_dup(other) ⇒ Object
:nodoc:.
-
#reload ⇒ Object
reload
the record and clears changed attributes. -
#save ⇒ Object
Attempts to
save
the record and clears changed attributes if successful. -
#save! ⇒ Object
Attempts to
save!
the record and clears changed attributes if successful.
Instance Method Details
#initialize_dup(other) ⇒ Object
:nodoc:
41 42 43 44 |
# File 'lib/active_record/attribute_methods/dirty.rb', line 41 def initialize_dup(other) # :nodoc: super init_changed_attributes end |
#reload ⇒ Object
reload
the record and clears changed attributes.
35 36 37 38 39 |
# File 'lib/active_record/attribute_methods/dirty.rb', line 35 def reload(*) super.tap do reset_changes end end |
#save ⇒ Object
Attempts to save
the record and clears changed attributes if successful.
20 21 22 23 24 25 |
# File 'lib/active_record/attribute_methods/dirty.rb', line 20 def save(*) if status = super changes_applied end status end |
#save! ⇒ Object
Attempts to save!
the record and clears changed attributes if successful.
28 29 30 31 32 |
# File 'lib/active_record/attribute_methods/dirty.rb', line 28 def save!(*) super.tap do changes_applied end end |