Class: Hyrax::Transactions::Steps::EnsureAdminSet
- Inherits:
-
Object
- Object
- Hyrax::Transactions::Steps::EnsureAdminSet
- Includes:
- Dry::Transaction::Operation
- Defined in:
- lib/hyrax/transactions/steps/ensure_admin_set.rb
Overview
A ‘dry-transaction` step that ensures the input `work` has an AdminSet.
Instance Method Summary collapse
-
#call(work) ⇒ Dry::Monads::Result
‘Failure` if there is no `AdminSet` for the input; `Success(input)`, otherwise.
Instance Method Details
#call(work) ⇒ Dry::Monads::Result
Returns ‘Failure` if there is no `AdminSet` for the input; `Success(input)`, otherwise.
17 18 19 |
# File 'lib/hyrax/transactions/steps/ensure_admin_set.rb', line 17 def call(work) work.admin_set_id ? Success(work) : Failure(:no_admin_set_id) end |