Method: Dynamoid::Document::ClassMethods#update
- Defined in:
- lib/dynamoid/document.rb
#update(hash_key, range_key_value = nil, attrs) ⇒ Dynamoid::Doument
Update document with provided values. Instantiates document and saves changes. Runs validations and callbacks.
159 160 161 162 163 |
# File 'lib/dynamoid/document.rb', line 159 def update(hash_key, range_key_value = nil, attrs) model = find(hash_key, range_key: range_key_value, consistent_read: true) model.update_attributes(attrs) model end |