module Opium::Model::Dirty

Public Class Methods

new( attributes = {} ) click to toggle source
Calls superclass method
# File lib/opium/model/dirty.rb, line 10
def initialize( attributes = {} )
  super( attributes ).tap { self.send :clear_changes_information }
end

Public Instance Methods

save( options = {} ) click to toggle source
Calls superclass method
# File lib/opium/model/dirty.rb, line 14
def save( options = {} )
  super( options ).tap { self.send :changes_applied }
end
save!( *args ) click to toggle source
Calls superclass method
# File lib/opium/model/dirty.rb, line 18
def save!( *args )
  super( *args ).tap { self.send :changes_applied }
end

Private Instance Methods

changes_applied() click to toggle source
# File lib/opium/model/dirty.rb, line 32
def changes_applied
  @previously_changed = changes
  @changed_attributes = ActiveSupport::HashWithIndifferentAccess.new
end
clear_changes_information() click to toggle source
# File lib/opium/model/dirty.rb, line 25
def clear_changes_information
  @previously_changed = ActiveSupport::HashWithIndifferentAccess.new
  @changed_attributes = ActiveSupport::HashWithIndifferentAccess.new
end