Class: Hyrax::Transactions::Steps::SaveWork Deprecated
- Inherits:
-
Object
- Object
- Hyrax::Transactions::Steps::SaveWork
- Includes:
- Dry::Transaction::Operation
- Defined in:
- lib/hyrax/transactions/steps/save_work.rb
Overview
Deprecated.
This is part of the legacy AF set of transaction steps for works. Transactions are not being used with AF works. This will be removed in 4.0.
A ‘dry-transaction` step that saves an input work.
Instance Method Summary collapse
-
#call(work) ⇒ Dry::Monads::Result
‘Failure` if the work fails to save; `Success(input)`, otherwise.
Instance Method Details
#call(work) ⇒ Dry::Monads::Result
Returns ‘Failure` if the work fails to save; `Success(input)`, otherwise.
32 33 34 |
# File 'lib/hyrax/transactions/steps/save_work.rb', line 32 def call(work) work.save ? Success(work) : Failure(work.errors) end |