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

pulibrary / tigerdata-app / 224f8641-1d8e-4439-afee-de59bc2c6742

06 Jan 2026 02:04PM UTC coverage: 90.99% (+0.008%) from 90.982%
224f8641-1d8e-4439-afee-de59bc2c6742

push

circleci

web-flow
Adding a planned maintenance flipper (#2338)

fixes #2287
<img width="1603" height="1225" alt="Screenshot 2026-01-05 at 4 00
20 PM"
src="https://github.com/user-attachments/assets/95412fb0-7432-42b3-8e03-e9e6e5044379"
/>

1 of 11 new or added lines in 2 files covered. (9.09%)

965 existing lines in 42 files now uncovered.

2969 of 3263 relevant lines covered (90.99%)

1221.88 hits per line

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

93.33
/app/controllers/edit_requests_controller.rb
1
# frozen_string_literal: true
UNCOV
2
class EditRequestsController < ApplicationController
4✔
UNCOV
3
  layout "edit_request"
4✔
UNCOV
4
  before_action :set_breadcrumbs
4✔
5

UNCOV
6
  before_action :set_request_model, only: %i[edit update]
4✔
UNCOV
7
  before_action :check_access
4✔
8

9
  # GET /edit_requests/1/edit
UNCOV
10
  def edit
4✔
11
    add_breadcrumb(@request_model.project_title, request_path(@request_model))
2✔
12
    add_breadcrumb("Edit Submitted Request")
2✔
UNCOV
13
  end
14

15
  # PATCH/PUT /edit_requests/1 or /edit_requests/1.json
UNCOV
16
  def update
4✔
17
    respond_to do |format|
4✔
18
      if @request_model.update(request_params) && @request_model.valid_to_submit?
4✔
19
        format.html { redirect_to request_url(@request_model), notice: I18n.t(:successful_update) }
4✔
20
        format.json { render :show, status: :ok, location: @request_model }
2✔
UNCOV
21
      else
22
        format.html { render :edit, status: :unprocessable_entity }
4✔
23
        format.json { render json: @request_model.errors, status: :unprocessable_entity }
2✔
UNCOV
24
      end
UNCOV
25
    end
UNCOV
26
  end
27

UNCOV
28
  private
4✔
29

30
    # Use callbacks to share common setup or constraints between actions.
UNCOV
31
    def set_request_model
4✔
32
      @princeton_departments = Affiliation.all
10✔
33
      @request_model = Request.find(params[:id])
10✔
UNCOV
34
    end
35

36
    # Only allow a list of trusted parameters through.
UNCOV
37
    def request_params
4✔
38
      request_params = params.fetch(:request, {}).permit(:request_title, :project_title, :state, :data_sponsor, :data_manager,
4✔
UNCOV
39
                                        :description, :project_purpose, :parent_folder, :project_folder, :project_id, :quota,
UNCOV
40
                                        :requested_by, :storage_size, :storage_unit, :number_of_files, :hpc, :smb, :globus,
UNCOV
41
                                        user_roles: [], departments: [])
42

43
      if request_params[:departments].present?
4✔
44
        request_params[:departments] = request_params[:departments].compact_blank.map { |dep_str| JSON.parse(dep_str) }
6✔
UNCOV
45
      end
46
      if request_params[:user_roles].present?
4✔
47
        request_params[:user_roles] = request_params[:user_roles].compact_blank.map { |role_str| JSON.parse(role_str) }
×
UNCOV
48
      end
49
      move_approved_values(request_params)
4✔
UNCOV
50
    end
51

UNCOV
52
    def move_approved_values(request_params)
4✔
53
      if request_params[:quota].present?
4✔
54
        request_params[:approved_quota] = request_params.delete(:quota)
2✔
UNCOV
55
      end
56
      if request_params[:storage_size].present?
4✔
57
        request_params[:approved_storage_size] = request_params.delete(:storage_size)
×
UNCOV
58
      end
59
      if request_params[:storage_unit].present?
4✔
60
        request_params[:approved_storage_unit] = request_params.delete(:storage_unit)
×
UNCOV
61
      end
62
      request_params
4✔
UNCOV
63
    end
64

UNCOV
65
    def set_breadcrumbs
4✔
66
      add_breadcrumb("Dashboard", dashboard_path)
10✔
67
      add_breadcrumb("Requests", requests_path)
10✔
UNCOV
68
    end
69

UNCOV
70
    def check_access
4✔
71
      return if user_eligible_to_modify_request?
10✔
72

73
      # request can not be modified by this user, redirect to the request
74
      flash[:notice] = I18n.t(:no_modify_submitted)
4✔
75
      redirect_to request_path(@request_model)
4✔
UNCOV
76
    end
77

UNCOV
78
    def user_eligible_to_modify_request?
4✔
79
      # elevated privs for the current user
80
      if current_user.sysadmin || (current_user.developer && !Rails.env.production?)
10✔
81
        true
6✔
UNCOV
82
      else
83
        false
4✔
UNCOV
84
      end
UNCOV
85
    end
UNCOV
86
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