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

pulibrary / pdc_describe / 4e4e59fc-9df4-4838-9fd4-6c7ea33cdb7c

07 Apr 2025 06:36PM UTC coverage: 1.283% (-94.6%) from 95.862%
4e4e59fc-9df4-4838-9fd4-6c7ea33cdb7c

Pull #1994

circleci

hectorcorrea
Switched to use the autocomplete that we aleady use for ROR. Integrated it with the existing logic for creators
Pull Request #1994: Started adding auto complete to contributors

0 of 46 new or added lines in 2 files covered. (0.0%)

4806 existing lines in 74 files now uncovered.

65 of 5065 relevant lines covered (1.28%)

0.01 hits per line

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

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

UNCOV
11
  private
×
12

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

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

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