-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TransactionWrite supports update() with a block for set, add and dele…
…te operations on fields
- Loading branch information
Showing
4 changed files
with
167 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'base' | ||
require 'dynamoid/persistence/update_validations' | ||
|
||
module Dynamoid | ||
class TransactionWrite | ||
class Update < Base | ||
def initialize(model, **options, &block) | ||
super() | ||
|
||
@model = model | ||
@save_action = Save.new(model, **options, &block) | ||
end | ||
|
||
def on_registration | ||
@save_action.on_registration | ||
end | ||
|
||
def on_commit | ||
@save_action.on_commit | ||
end | ||
|
||
def on_rollback | ||
@save_action.on_rollback | ||
end | ||
|
||
def aborted? | ||
@save_action.aborted? | ||
end | ||
|
||
def skipped? | ||
@save_action.skipped? | ||
end | ||
|
||
def observable_by_user_result | ||
@save_action.observable_by_user_result | ||
end | ||
|
||
def action_request | ||
@save_action.action_request | ||
end | ||
end | ||
end | ||
end |