Module: Dynamoid::Dirty::ClassMethods

Defined in:
lib/dynamoid/dirty.rb

Instance Method Summary collapse

Instance Method Details

#from_database(attributes_from_database) ⇒ Object



39
40
41
42
43
44
# File 'lib/dynamoid/dirty.rb', line 39

def from_database(attributes_from_database)
  super.tap do |model|
    model.clear_changes_information
    model.assign_attributes_from_database(DeepDupper.dup_attributes(model.attributes, model.class))
  end
end

#update_fieldsObject



27
28
29
30
31
# File 'lib/dynamoid/dirty.rb', line 27

def update_fields(*)
  super.tap do |model|
    model.clear_changes_information if model
  end
end

#upsertObject



33
34
35
36
37
# File 'lib/dynamoid/dirty.rb', line 33

def upsert(*)
  super.tap do |model|
    model.clear_changes_information if model
  end
end