Class: Dynamoid::Transactions::Mutation::Base
- Inherits:
-
Object
- Object
- Dynamoid::Transactions::Mutation::Base
- Defined in:
- lib/dynamoid/transactions/mutation/base.rb
Direct Known Subclasses
Create, DeleteWithInstance, DeleteWithPrimaryKey, Destroy, Import, Inc, Increment, Save, Touch, UpdateAttributes, UpdateFields, Upsert
Class Method Summary collapse
Instance Method Summary collapse
-
#aborted? ⇒ Boolean
Whether some callback aborted or canceled an action.
-
#action_requests ⇒ Object
Coresponding part of a final request body.
-
#observable_by_user_result ⇒ Object
Value returned to a user as an action result.
-
#on_commit ⇒ Object
Callback called after changes are persisted.
-
#on_registration ⇒ Object
Callback called at "initialization" or "registration" an action before changes are persisted.
-
#on_rollback ⇒ Object
Callback called when a transaction is rolled back.
-
#skipped? ⇒ Boolean
Whether there are changes to persist, e.g.
Class Method Details
.validate_attribute_names!(model_class, names) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/dynamoid/transactions/mutation/base.rb', line 48 def self.validate_attribute_names!(model_class, names) names.each do |name| unless model_class.attributes[name] raise Dynamoid::Errors::UnknownAttribute.new(model_class, name) end end end |
Instance Method Details
#aborted? ⇒ Boolean
Whether some callback aborted or canceled an action
28 29 30 |
# File 'lib/dynamoid/transactions/mutation/base.rb', line 28 def aborted? raise 'Not implemented' end |
#action_requests ⇒ Object
Coresponding part of a final request body
44 45 46 |
# File 'lib/dynamoid/transactions/mutation/base.rb', line 44 def action_requests raise 'Not implemented' end |
#observable_by_user_result ⇒ Object
Value returned to a user as an action result
39 40 41 |
# File 'lib/dynamoid/transactions/mutation/base.rb', line 39 def observable_by_user_result raise 'Not implemented' end |
#on_commit ⇒ Object
Callback called after changes are persisted. It's a proper place to mark changes in a model as applied.
17 18 19 |
# File 'lib/dynamoid/transactions/mutation/base.rb', line 17 def on_commit raise 'Not implemented' end |
#on_registration ⇒ Object
Callback called at "initialization" or "registration" an action before changes are persisted. It's a proper place to validate a model or run callbacks
11 12 13 |
# File 'lib/dynamoid/transactions/mutation/base.rb', line 11 def on_registration raise 'Not implemented' end |
#on_rollback ⇒ Object
Callback called when a transaction is rolled back. It's a proper place to undo changes made in after_... callbacks.
23 24 25 |
# File 'lib/dynamoid/transactions/mutation/base.rb', line 23 def on_rollback raise 'Not implemented' end |
#skipped? ⇒ Boolean
Whether there are changes to persist, e.g. updating a model with no attribute changed is skipped.
34 35 36 |
# File 'lib/dynamoid/transactions/mutation/base.rb', line 34 def skipped? raise 'Not implemented' end |