• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / pdc_describe / d9f86608-3df2-4f43-8850-71459996c82b

25 Mar 2024 12:07PM UTC coverage: 30.999% (-65.2%) from 96.206%
d9f86608-3df2-4f43-8850-71459996c82b

Pull #1710

circleci

carolyncole
Separating edit into wizard and non wizard controller methods
Pull Request #1710: Separating wizard new & edit and non wizard new & edit controller methods

956 of 3084 relevant lines covered (31.0%)

0.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

25.0
/app/controllers/work_migration_controller.rb
1
# frozen_string_literal: true
2
class WorkMigrationController < ApplicationController
1✔
3
  def migrate
1✔
4
    work = Work.find(params[:id])
×
5
    if work.ark.present? && current_user.can_admin?(work.group)
×
6
      begin
7
        run_migration(work)
×
8
      rescue RuntimeError => e
9
        flash[:notice] = e.message
×
10
      end
11
    elsif !current_user.can_admin?(work.group)
×
12
      flash[:notice] = "Unauthorized migration"
×
13
      Honeybadger.notify("Unauthorized to migration work #{work.id} (current user: #{current_user.id})")
×
14
    else
15
      flash[:notice] = "The ark is blank, no migration from Dataspace is possible"
×
16
    end
17
    redirect_to work_path(work)
×
18
  end
19

20
  private
1✔
21

22
    def run_migration(work)
1✔
23
      dspace = PULDspaceMigrate.new(work, current_user)
×
24
      dspace.migrate
×
25
      flash[:notice] = dspace.migration_message
×
26
    end
27
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc