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

curationexperts / laevigata / c8f284b3-21d1-4be6-8347-ee3a5815cd73

07 May 2026 11:22PM UTC coverage: 97.443%. Remained the same
c8f284b3-21d1-4be6-8347-ee3a5815cd73

push

circleci

mark-dce
Update Laney and Rollins programs

**ISSUE**
In order to edit ETDs submitted with various legacy department names,
those departments need to be in the present in the vocabulary. If
the department name is not present, the ETD may not be editable or
may cause an exception when trying to save it.

**RESOLUTION**
Ensure legacy department names are in the program lists for
relevant schools.

NOTE: This P.R. also deactivates Laney schools per
Freshdesk Ticket #251

2782 of 2855 relevant lines covered (97.44%)

49.77 hits per line

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

97.62
/app/controllers/in_progress_etds_controller.rb
1
class InProgressEtdsController < ApplicationController
2✔
2
  def new
2✔
3
    authorize! :create, InProgressEtd
10✔
4

5
    @in_progress_etd = if params[:etd_id]
9✔
6
                         InProgressEtd.find_or_create_by(etd_id: params[:etd_id])
5✔
7
                       else
8
                         InProgressEtd.find_or_create_by(user_ppid: current_user.ppid)
4✔
9
                       end
10

11
    # Now that the record has been created, render the form so student can edit it:
12
    redirect_to action: :edit, id: @in_progress_etd.id
9✔
13
  end
14

15
  # Note: There is no 'create' action because the 'new' action does 'find or create'.
16

17
  def edit
2✔
18
    if current_user.nil?
15✔
19
      redirect_to new_user_session_path
2✔
20
    else
21
      @in_progress_etd = InProgressEtd.find(params[:id])
13✔
22
      authorize! :update, @in_progress_etd
12✔
23
      @in_progress_etd.refresh_from_etd!
10✔
24
      @data = @in_progress_etd.data
10✔
25
      @form_level = form_level
10✔
26
    end
27
  rescue ActiveRecord::RecordNotFound
28
    redirect_to root_url
1✔
29
  end
30

31
  # The Vue.js form uses this action to update the record.
32
  def update
2✔
33
    @in_progress_etd = InProgressEtd.find(params[:id])
13✔
34
    authorize! :update, @in_progress_etd
13✔
35
    @in_progress_etd.data = prepare_etd_data
11✔
36

37
    if @in_progress_etd.save
11✔
38
      @data = @in_progress_etd.data
11✔
39
      render json: { in_progress_etd: @data.to_json, lastCompletedStep: current_step(@data), tab_name: tab_name }, status: 200
11✔
40
    else
41
      render json: { errors: @in_progress_etd.errors.messages }, status: 422
×
42
    end
43
  end
44

45
  def destroy
2✔
46
    @in_progress_etd = InProgressEtd.find(params[:id])
2✔
47
    authorize! :update, @in_progress_etd
2✔
48
    @in_progress_etd.destroy
1✔
49

50
    redirect_to root_url
1✔
51
  end
52

53
  private
2✔
54

55
    def current_step(data)
2✔
56
      data['currentStep']
11✔
57
    end
58

59
    def tab_name
2✔
60
      etd = request.parameters.fetch(:etd)
11✔
61
      etd.fetch(:currentTab, "About Me")
11✔
62
    end
63

64
    def prepare_etd_data
2✔
65
      # TODO: strong params
66
      new_data = request.parameters.fetch(:etd, {})
11✔
67

68
      # Add the new data to the existing persisted data
69
      @in_progress_etd.add_data(new_data)
11✔
70
    end
71

72
    # Show :basic form for regular users - e.g. active field values only
73
    # Or :advanced form for super_admins - e.g. also show inactive fields values
74
    def form_level
2✔
75
      return :advanced if current_user.admin?
10✔
76
      return :advanced if current_ability.can_review_submissions?
4✔
77
      :basic
3✔
78
    end
79
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

© 2026 Coveralls, Inc