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

pulibrary / pdc_describe / 9091a1ae-29be-458c-984a-339d213919c4

12 Dec 2024 07:41PM UTC coverage: 26.434% (-69.7%) from 96.113%
9091a1ae-29be-458c-984a-339d213919c4

Pull #2000

circleci

jrgriffiniii
Removing integration with ActiveStorage
Pull Request #2000: Bump actionpack from 7.2.1.1 to 7.2.2.1

945 of 3575 relevant lines covered (26.43%)

0.35 hits per line

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

5.26
/app/controllers/reports_controller.rb
1
# frozen_string_literal: true
2
class ReportsController < ApplicationController
1✔
3
  def dataset_list
×
4
    if current_user.super_admin? || current_user.moderator?
×
5
      @works = Work.where(sql_where(params))
×
6
    else
7
      redirect_to "/"
×
8
    end
9
  end
10

11
  private
×
12

13
    def sql_where(params)
×
14
      sql_where = []
×
15
      if params["status"] == "finished"
×
16
        sql_where << "state = 'approved'"
×
17
      elsif params["status"] == "unfinished"
×
18
        sql_where << "state != 'approved'"
×
19
      end
20

21
      if params["group"].present? && params["group"] != "ALL"
×
22
        group_id = Group.where(code: params["group"]).first.id
×
23
        sql_where << "group_id = #{group_id}"
×
24
      end
25

26
      if params["year"].present? && params["year"] != "ALL"
×
27
        year = params["year"].to_i # Force to int to guard against SQL injection
×
28
        sql_where << "metadata->>'publication_year' = '#{year}'"
×
29
      end
30
      sql_where.join(" AND ")
×
31
    end
32
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