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

pulibrary / pdc_describe / 6cdfa4c0-936a-4eda-967f-698c2648589a

19 Dec 2024 06:26PM UTC coverage: 95.796% (-0.3%) from 96.113%
6cdfa4c0-936a-4eda-967f-698c2648589a

Pull #1994

circleci

claudiawulee
added researchers view
Pull Request #1994: Started adding auto complete to contributors

12 of 24 new or added lines in 2 files covered. (50.0%)

3350 of 3497 relevant lines covered (95.8%)

408.62 hits per line

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

35.29
/app/models/researcher.rb
1
# frozen_string_literal: true
2
class Researcher < ApplicationRecord
2✔
3
  def self.new_researcher(first_name, last_name, orcid, netid)
2✔
NEW
4
    researcher = Researcher.where(orcid: orcid).first
×
NEW
5
    if researcher == nil
×
NEW
6
      researcher = Researcher.new
×
NEW
7
      researcher.netid = netid
×
8
    end
NEW
9
    researcher.first_name = first_name
×
NEW
10
    researcher.last_name = last_name
×
NEW
11
    researcher.orcid = orcid
×
NEW
12
    researcher.save!
×
NEW
13
    return researcher
×
14
  end
15

16
  def self.autocomplete_list
2✔
17
    researchers = []
38✔
18
    Researcher.all.each do |researcher|
38✔
NEW
19
      display_value = "#{researcher.first_name} #{researcher.last_name} (#{researcher.netid})"
×
NEW
20
      researchers << {value: display_value, data: researcher.netid}
×
21
    end
22
    return researchers
38✔
23
  end
24
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