Class: WorkMigrationController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- WorkMigrationController
- Defined in:
- app/controllers/work_migration_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#migrate ⇒ Object
Note:
No testing coverage for RuntimeError but depends on Dspaces
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/work_migration_controller.rb', line 4 def migrate work = Work.find(params[:id]) if work.ark.present? && current_user.can_admin?(work.group) begin run_migration(work) rescue RuntimeError => e flash[:notice] = e. end elsif !current_user.can_admin?(work.group) flash[:notice] = "Unauthorized migration" Honeybadger.notify("Unauthorized to migration work #{work.id} (current user: #{current_user.id})") else flash[:notice] = "The ark is blank, no migration from Dataspace is possible" end redirect_to work_path(work) end |