Module: CurationConcerns::LeasesControllerBehavior
- Extended by:
- ActiveSupport::Concern
- Includes:
- Collections::AcceptsBatches, ManagesEmbargoes
- Included in:
- LeasesController
- Defined in:
- app/controllers/concerns/curation_concerns/leases_controller_behavior.rb
Class Method Summary collapse
-
.local_prefixes ⇒ Object
This allows us to use the unauthorized template in curation_concerns/base.
Instance Method Summary collapse
-
#destroy ⇒ Object
Removes a single lease.
- #index ⇒ Object
- #update ⇒ Object
Methods included from Collections::AcceptsBatches
#batch, #batch=, #check_for_empty_batch?
Methods included from ManagesEmbargoes
Class Method Details
.local_prefixes ⇒ Object
This allows us to use the unauthorized template in curation_concerns/base
33 34 35 |
# File 'app/controllers/concerns/curation_concerns/leases_controller_behavior.rb', line 33 def self.local_prefixes ['curation_concerns/base'] end |
Instance Method Details
#destroy ⇒ Object
Removes a single lease
12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/concerns/curation_concerns/leases_controller_behavior.rb', line 12 def destroy CurationConcerns::Actors::LeaseActor.new(curation_concern).destroy flash[:notice] = curation_concern.lease_history.last if curation_concern.work? && curation_concern.file_sets.present? redirect_to (curation_concern) else redirect_to edit_lease_path(curation_concern) end end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/concerns/curation_concerns/leases_controller_behavior.rb', line 7 def index :index, Hydra::AccessControls::Lease end |
#update ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'app/controllers/concerns/curation_concerns/leases_controller_behavior.rb', line 22 def update filter_docs_with_edit_access! copy_visibility = params[:leases].values.map { |h| h[:copy_visibility] } ActiveFedora::Base.find(batch).each do |curation_concern| CurationConcerns::Actors::LeaseActor.new(curation_concern).destroy curation_concern.copy_visibility_to_files if copy_visibility.include?(curation_concern.id) end redirect_to leases_path end |