Class: Dynamoid::Transactions::Mutation::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamoid/transactions/mutation/base.rb

Class Method Summary collapse

Instance Method Summary collapse

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

Returns:

  • (Boolean)


28
29
30
# File 'lib/dynamoid/transactions/mutation/base.rb', line 28

def aborted?
  raise 'Not implemented'
end

#action_requestsObject

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_resultObject

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_commitObject

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_registrationObject

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_rollbackObject

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.

Returns:

  • (Boolean)


34
35
36
# File 'lib/dynamoid/transactions/mutation/base.rb', line 34

def skipped?
  raise 'Not implemented'
end