Class: Hyrax::Transactions::Steps::SetDefaultAdminSet

Inherits:
Object
  • Object
show all
Defined in:
lib/hyrax/transactions/steps/set_default_admin_set.rb

Overview

A step that sets the `AdminSet` for an input work to the default admin set if none is already set. Creates the default admin set if it doesn't already exist.

Since:

  • 2.4.0

Instance Method Summary collapse

Instance Method Details

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

Parameters:

  • obj (#admin_set_id=)

Returns:

  • (Dry::Monads::Result)

Since:

  • 2.4.0


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

def call(obj)
  obj.admin_set_id ||= Hyrax::EnsureWellFormedAdminSetService.call

  Success(obj)
end