Class: Hyrax::ActorFactory

Inherits:
Object
  • Object
show all
Defined in:
app/services/hyrax/actor_factory.rb

Class Method Summary collapse

Class Method Details

.build(curation_concern, current_ability) ⇒ Object



22
23
24
25
26
# File 'app/services/hyrax/actor_factory.rb', line 22

def self.build(curation_concern, current_ability)
  Actors::ActorStack.new(curation_concern,
                         current_ability,
                         stack_actors(curation_concern))
end

.model_actor(curation_concern) ⇒ Object



28
29
30
31
# File 'app/services/hyrax/actor_factory.rb', line 28

def self.model_actor(curation_concern)
  actor_identifier = curation_concern.class.to_s
  "Hyrax::Actors::#{actor_identifier}Actor".constantize
end

.stack_actors(curation_concern) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/services/hyrax/actor_factory.rb', line 3

def self.stack_actors(curation_concern)
  [Hyrax::Actors::TransactionalRequest,
   Hyrax::Actors::OptimisticLockValidator,
   CreateWithRemoteFilesActor,
   CreateWithFilesActor,
   Hyrax::Actors::AddAsMemberOfCollectionsActor,
   Hyrax::Actors::AddToWorkActor,
   Hyrax::Actors::AssignRepresentativeActor,
   Hyrax::Actors::AttachFilesActor,
   Hyrax::Actors::AttachMembersActor,
   Hyrax::Actors::ApplyOrderActor,
   Hyrax::Actors::InterpretVisibilityActor,
   DefaultAdminSetActor,
   ApplyPermissionTemplateActor,
   model_actor(curation_concern),
   # Initialize workflow after model is saved
   Hyrax::Actors::InitializeWorkflowActor]
end