Class: CurationConcerns::Actors::AddToWorkActor

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

Overview

Since:

  • 0.14.0

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 CurationConcerns::Actors::AbstractActor

Instance Method Details

#create(attributes) ⇒ Object

Since:

  • 0.14.0



4
5
6
7
# File 'app/actors/curation_concerns/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

Since:

  • 0.14.0



9
10
11
12
# File 'app/actors/curation_concerns/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