Module: CurationConcerns::LeasesControllerBehavior
- Extended by:
- ActiveSupport::Concern
- Includes:
- ManagesEmbargoes, Hydra::Collections::AcceptsBatches
- Included in:
- LeasesController
- Defined in:
- app/controllers/concerns/curation_concerns/leases_controller_behavior.rb
Instance Method Summary collapse
-
#destroy ⇒ Object
Removes a single lease.
- #index ⇒ Object
- #update ⇒ Object
Methods included from ManagesEmbargoes
Instance Method Details
#destroy ⇒ Object
Removes a single lease
16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/concerns/curation_concerns/leases_controller_behavior.rb', line 16 def destroy 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
11 12 13 |
# File 'app/controllers/concerns/curation_concerns/leases_controller_behavior.rb', line 11 def index :index, Hydra::AccessControls::Lease end |
#update ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/concerns/curation_concerns/leases_controller_behavior.rb', line 26 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| LeaseActor.new(curation_concern).destroy curation_concern.copy_visibility_to_files if copy_visibility.include?(curation_concern.id) end redirect_to leases_path end |