Sha256: 5bf164b770c1e28346895b9a844f537a364d679533ebb5b572f0cd8ee60cc929

Contents?: true

Size: 631 Bytes

Versions: 24

Compression:

Stored size: 631 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  module Transactions
    module Steps
      ##
      # 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
      class SetDefaultAdminSet
        include Dry::Monads[:result]

        ##
        # @param [#admin_set_id=] obj
        #
        # @return [Dry::Monads::Result]
        def call(obj)
          obj.admin_set_id ||= Hyrax::EnsureWellFormedAdminSetService.call

          Success(obj)
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
hyrax-5.0.1 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-5.0.0 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-5.0.0.rc3 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-5.0.0.rc2 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-5.0.0.rc1 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-3.6.0 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-4.0.0 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-4.0.0.rc3 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-4.0.0.rc2 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-4.0.0.rc1 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-3.5.0 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-4.0.0.beta2 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-3.4.2 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-4.0.0.beta1 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-3.4.1 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-3.4.0 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-3.3.0 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-3.2.0 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-3.1.0 lib/hyrax/transactions/steps/set_default_admin_set.rb
hyrax-3.0.2 lib/hyrax/transactions/steps/set_default_admin_set.rb