Class: EmbargoesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- EmbargoesController
- Includes:
- Hydra::Collections::AcceptsBatches, Worthwhile::ManagesEmbargoes, Worthwhile::WithoutNamespace
- Defined in:
- app/controllers/embargoes_controller.rb
Instance Method Summary collapse
-
#destroy ⇒ Object
Remove an active or lapsed embargo.
- #update ⇒ Object
Methods included from Worthwhile::ManagesEmbargoes
Instance Method Details
#destroy ⇒ Object
Remove an active or lapsed embargo
10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/embargoes_controller.rb', line 10 def destroy update_files = !curation_concern. # embargo expired (curation_concern) flash[:notice] = curation_concern..last if update_files redirect_to (curation_concern) else redirect_to (curation_concern) end end |
#update ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/embargoes_controller.rb', line 21 def update filter_docs_with_edit_access! copy_visibility = params[:embargoes].values.map { |h| h[:copy_visibility] } batch.each do |id| ActiveFedora::Base.find(id).tap do |curation_concern| (curation_concern) curation_concern.copy_visibility_to_files if copy_visibility.include?(id) end end redirect_to end |