Module: Acfs::Resource::Dirty

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::Dirty
Included in:
Acfs::Resource
Defined in:
lib/acfs/resource/dirty.rb

Overview

Thin wrapper around ActiveModel::Dirty

Instance Method Summary collapse

Instance Method Details

#loaded!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



25
26
27
28
# File 'lib/acfs/resource/dirty.rb', line 25

def loaded!
  reset_changes
  super
end

#reset_changesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



13
14
15
# File 'lib/acfs/resource/dirty.rb', line 13

def reset_changes
  clear_changes_information
end

#save!(**kwargs) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
# File 'lib/acfs/resource/dirty.rb', line 19

def save!(**kwargs)
  super(**kwargs).tap {|_| changes_applied }
end

#write_raw_attribute(name, value, opts = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
35
# File 'lib/acfs/resource/dirty.rb', line 32

def write_raw_attribute(name, value, opts = {})
  attribute_will_change!(name) if opts[:change].nil? || opts[:change]
  super
end