Class: Hyrax::Actors::OrderedMembersActor
- Inherits:
-
FileSetActor
- Object
- FileSetActor
- Hyrax::Actors::OrderedMembersActor
- Includes:
- Lockable
- Defined in:
- app/actors/hyrax/actors/ordered_members_actor.rb
Instance Attribute Summary collapse
-
#ordered_members ⇒ Object
readonly
Returns the value of attribute ordered_members.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Attributes inherited from FileSetActor
#attributes, #file_set, #use_valkyrie
Instance Method Summary collapse
-
#attach_ordered_members_to_work(work) ⇒ Object
Adds FileSets to the work using ore:Aggregations.
-
#initialize(ordered_members, user) ⇒ OrderedMembersActor
constructor
A new instance of OrderedMembersActor.
Methods included from Lockable
#acquire_lock_for, #lock_manager
Methods inherited from FileSetActor
#attach_to_af_work, #attach_to_valkyrie_work, #attach_to_work, #create_content, #create_metadata, #destroy, #revert_content, #update_content, #update_metadata
Constructor Details
#initialize(ordered_members, user) ⇒ OrderedMembersActor
Returns a new instance of OrderedMembersActor.
9 10 11 12 |
# File 'app/actors/hyrax/actors/ordered_members_actor.rb', line 9 def initialize(ordered_members, user) @ordered_members = ordered_members @user = user end |
Instance Attribute Details
#ordered_members ⇒ Object (readonly)
Returns the value of attribute ordered_members.
7 8 9 |
# File 'app/actors/hyrax/actors/ordered_members_actor.rb', line 7 def ordered_members @ordered_members end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
7 8 9 |
# File 'app/actors/hyrax/actors/ordered_members_actor.rb', line 7 def user @user end |
Instance Method Details
#attach_ordered_members_to_work(work) ⇒ Object
Adds FileSets to the work using ore:Aggregations. Locks to ensure that only one process is operating on the list at a time.
17 18 19 20 21 22 23 24 25 |
# File 'app/actors/hyrax/actors/ordered_members_actor.rb', line 17 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 |