Sha256: cb96a6d59f65b3044ad55ca442acf5d2b77457580200ba3ab884a218adbc884a

Contents?: true

Size: 829 Bytes

Versions: 29

Compression:

Stored size: 829 Bytes

Contents

# frozen_string_literal: true

module Hyrax
  module Actors
    class OrderedMembersActor < FileSetActor
      include Lockable
      attr_reader :ordered_members, :user

      def initialize(ordered_members, user)
        @ordered_members = ordered_members
        @user = user
      end

      # Adds FileSets to the work using ore:Aggregations.
      # Locks to ensure that only one process is operating on the list at a time.
      # @param [ActiveFedora::Base] work the parent work
      def attach_ordered_members_to_work(work)
        acquire_lock_for(work.id) do
          work.ordered_members = ordered_members
          work.save
          ordered_members.each do |file_set|
            Hyrax.config.callback.run(:after_create_fileset, file_set, user, warn: false)
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-5.0.4 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-5.0.3 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-5.0.2 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-5.0.1 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-5.0.0 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-5.0.0.rc3 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-5.0.0.rc2 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-5.0.0.rc1 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-3.6.0 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-4.0.0 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-4.0.0.rc3 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-4.0.0.rc2 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-4.0.0.rc1 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-3.5.0 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-4.0.0.beta2 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-3.4.2 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-4.0.0.beta1 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-3.4.1 app/actors/hyrax/actors/ordered_members_actor.rb
hyrax-3.4.0 app/actors/hyrax/actors/ordered_members_actor.rb