Class: Hyrax::Actors::BaseActor
- Inherits:
-
AbstractActor
- Object
- AbstractActor
- Hyrax::Actors::BaseActor
- Defined in:
- app/actors/hyrax/actors/base_actor.rb
Overview
Defines the basic save/destroy and callback behavior, intended to run near the bottom of the actor stack.
Instance Attribute Summary
Attributes inherited from AbstractActor
Instance Method Summary collapse
-
#create(env) ⇒ Boolean
True if create was successful.
-
#destroy(env) ⇒ Boolean
True if destroy 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.
18 19 20 21 22 |
# File 'app/actors/hyrax/actors/base_actor.rb', line 18 def create(env) apply_creation_data_to_curation_concern(env) apply_save_data_to_curation_concern(env) save(env) && next_actor.create(env) && run_callbacks(:after_create_concern, env) end |
#destroy(env) ⇒ Boolean
Returns true if destroy was successful.
34 35 36 37 38 39 40 41 |
# File 'app/actors/hyrax/actors/base_actor.rb', line 34 def destroy(env) env.curation_concern.in_collection_ids.each do |id| destination_collection = ::Collection.find(id) destination_collection.members.delete(env.curation_concern) destination_collection.update_index end env.curation_concern.destroy end |
#update(env) ⇒ Boolean
Returns true if update was successful.
26 27 28 29 30 |
# File 'app/actors/hyrax/actors/base_actor.rb', line 26 def update(env) apply_update_data_to_curation_concern(env) apply_save_data_to_curation_concern(env) next_actor.update(env) && save(env) && run_callbacks(:after_update_metadata, env) end |