Class: Hyrax::Actors::AddToWorkActor

Inherits:
AbstractActor show all
Defined in:
app/actors/hyrax/actors/add_to_work_actor.rb

Instance Attribute Summary

Attributes inherited from AbstractActor

#next_actor

Instance Method Summary collapse

Methods inherited from AbstractActor

#initialize

Constructor Details

This class inherits a constructor from Hyrax::Actors::AbstractActor

Instance Method Details

#create(attributes) ⇒ Object



4
5
6
7
# File 'app/actors/hyrax/actors/add_to_work_actor.rb', line 4

def create(attributes)
  work_ids = attributes.delete(:in_works_ids)
  next_actor.create(attributes) && add_to_works(work_ids)
end

#update(attributes) ⇒ Object



9
10
11
12
# File 'app/actors/hyrax/actors/add_to_work_actor.rb', line 9

def update(attributes)
  work_ids = attributes.delete(:in_works_ids)
  add_to_works(work_ids) && next_actor.update(attributes)
end