Class: Hyrax::Actors::AddToWorkActor
- Inherits:
-
AbstractActor
- Object
- AbstractActor
- Hyrax::Actors::AddToWorkActor
- Defined in:
- app/actors/hyrax/actors/add_to_work_actor.rb
Instance Attribute Summary
Attributes inherited from AbstractActor
Instance Method Summary collapse
-
#create(env) ⇒ Boolean
True if create was successful.
-
#update(env) ⇒ Boolean
True if update was successful.
Methods inherited from AbstractActor
Constructor Details
This class inherits a constructor from Hyrax::Actors::AbstractActor
Instance Method Details
#create(env) ⇒ Boolean
Returns true if create was successful.
7 8 9 10 11 12 13 |
# File 'app/actors/hyrax/actors/add_to_work_actor.rb', line 7 def create(env) work_ids = env.attributes.delete(:in_works_ids) can_edit_works?(env, work_ids) && next_actor.create(env) && add_to_works(env, work_ids) end |
#update(env) ⇒ Boolean
Returns true if update was successful.
17 18 19 20 |
# File 'app/actors/hyrax/actors/add_to_work_actor.rb', line 17 def update(env) work_ids = env.attributes.delete(:in_works_ids) add_to_works(env, work_ids) && next_actor.update(env) end |