Module: ActiveAttr::Dirty
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActiveModel::Dirty
- Included in:
- ActiveForce::SObject
- Defined in:
- lib/active_attr/dirty.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #attributes_and_changes ⇒ Object
- #forget_attribute_assignments ⇒ Object
- #mutations_from_database ⇒ Object
Instance Method Details
#attributes_and_changes ⇒ Object
21 22 23 |
# File 'lib/active_attr/dirty.rb', line 21 def attributes_and_changes attributes.select { |attr, key| changed.include? attr } end |
#forget_attribute_assignments ⇒ Object
30 31 32 |
# File 'lib/active_attr/dirty.rb', line 30 def forget_attribute_assignments @attributes if defined?(@attributes) end |
#mutations_from_database ⇒ Object
25 26 27 28 |
# File 'lib/active_attr/dirty.rb', line 25 def mutations_from_database #@mutations_from_database ||= ActiveModel::NullMutationTracker.instance @mutations_from_database ||= defined?(ActiveModel::ForcedMutationTracker) ? ActiveModel::ForcedMutationTracker.new(self) : ActiveModel::NullMutationTracker.instance end |