Class: Hyrax::Transactions::Steps::DestroyWork Deprecated

Inherits:
Object
  • Object
show all
Includes:
Dry::Transaction::Operation
Defined in:
lib/hyrax/transactions/steps/destroy_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-transcation` step that destroys a Work.

See Also:

Since:

  • 3.0.0

Instance Method Summary collapse

Instance Method Details

#call(work) ⇒ Dry::Monads::Result

Parameters:

Returns:

  • (Dry::Monads::Result)

Since:

  • 3.0.0


19
20
21
22
23
# File 'lib/hyrax/transactions/steps/destroy_work.rb', line 19

def call(work)
  work.destroy! && Success(work)
rescue => err
  Failure(err)
end