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

pulibrary / allsearch_api / 9eae8e03-b4ba-4fef-a63b-d5780d976746

30 Jun 2025 12:00PM UTC coverage: 99.492% (+0.001%) from 99.491%
9eae8e03-b4ba-4fef-a63b-d5780d976746

Pull #379

circleci

maxkadel
Ensure we sort library staff correctly, and include bios in searchable field

Closes #371

Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>
Co-authored-by: Kevin Reiss <kevinreiss@users.noreply.github.com>
Co-authored-by: Ryan Laddusaw <rladdusaw@users.noreply.github.com>
Pull Request #379: Ensure we sort library staff correctly, and include bios in searchabl…

3 of 3 new or added lines in 1 file covered. (100.0%)

95 existing lines in 17 files now uncovered.

979 of 984 relevant lines covered (99.49%)

101.71 hits per line

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

100.0
/app/models/library_staff_document.rb
1
# frozen_string_literal: true
2

3
# This class is responsible for getting relevant
4
# metadata from the LibraryStaffRecords in the database
5
# The document is a LibraryStaffRecord
6
# :reek:TooManyMethods
7
class LibraryStaffDocument < Document
3✔
8
  private
3✔
9

10
  # Use the full name as the document title
11
  def title
3✔
UNCOV
12
    document.name
14✔
13
  end
14

15
  def first_name
3✔
UNCOV
16
    document.first_name
14✔
17
  end
18

19
  def middle_name
3✔
UNCOV
20
    document.middle_name
14✔
21
  end
22

23
  def last_name
3✔
UNCOV
24
    document.last_name
14✔
25
  end
26

27
  # Not relevant for this service
28
  def creator; end
3✔
29

30
  # Not relevant for this service
31
  def publisher; end
3✔
32

33
  def id
3✔
UNCOV
34
    document.puid
14✔
35
  end
36

37
  def netid
3✔
UNCOV
38
    document.netid
14✔
39
  end
40

41
  def phone
3✔
UNCOV
42
    document.phone
14✔
43
  end
44

45
  def email
3✔
UNCOV
46
    document.email
14✔
47
  end
48

49
  def library_title
3✔
UNCOV
50
    document.library_title
14✔
51
  end
52

53
  def team
3✔
UNCOV
54
    document.team
14✔
55
  end
56

57
  def division
3✔
UNCOV
58
    document.division
14✔
59
  end
60

61
  def department
3✔
UNCOV
62
    document.department
14✔
63
  end
64

65
  def unit
3✔
UNCOV
66
    document.unit
14✔
67
  end
68

69
  def office
3✔
UNCOV
70
    document.office
14✔
71
  end
72

73
  def building
3✔
UNCOV
74
    document.building
14✔
75
  end
76

77
  def pronouns
3✔
UNCOV
78
    document.pronouns
14✔
79
  end
80

81
  def type
3✔
UNCOV
82
    'Library Staff'
14✔
83
  end
84

85
  # Not relevant for this service
86
  def description; end
3✔
87

88
  def url
3✔
89
    path = "/about/staff-directory/#{name_to_path}"
19✔
90
    URI::HTTPS.build(host: LibraryWebsite.library_website_host, path:)
19✔
91
  end
92

93
  def name_to_path
3✔
94
    URI::DEFAULT_PARSER.escape("#{document.first_name}-#{document.last_name}".delete(".'").gsub(' ', '-').downcase)
21✔
95
  end
96

97
  def doc_keys
3✔
UNCOV
98
    [:first_name, :middle_name, :last_name, :netid, :library_title, :phone, :email, :team, :division, :department,
14✔
99
     :unit, :office, :building, :pronouns]
100
  end
101
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