Class: Hyrax::Actors::CollectionsMembershipActor
- Inherits:
-
AbstractActor
- Object
- AbstractActor
- Hyrax::Actors::CollectionsMembershipActor
- Defined in:
- app/actors/hyrax/actors/collections_membership_actor.rb
Overview
Adds membership to and removes membership from collections
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 |
# File 'app/actors/hyrax/actors/collections_membership_actor.rb', line 7 def create(env) collection_ids = env.attributes.delete(:member_of_collection_ids) assign_collections(env, collection_ids) && next_actor.create(env) end |
#update(env) ⇒ Boolean
Returns true if update was successful.
14 15 16 17 |
# File 'app/actors/hyrax/actors/collections_membership_actor.rb', line 14 def update(env) collection_ids = env.attributes.delete(:member_of_collection_ids) assign_collections(env, collection_ids) && next_actor.update(env) end |