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

pulibrary / bibdata / f04bc944-f9b4-4a42-8b26-dcacd0e3e688

11 Mar 2025 10:27PM UTC coverage: 34.017% (-58.1%) from 92.162%
f04bc944-f9b4-4a42-8b26-dcacd0e3e688

Pull #2653

circleci

christinach
Add new lc_subject_facet field.
Helps with the vocabulary work https://github.com/pulibrary/orangelight/pull/3386
In this new field we index only the lc subject heading and the subdivisions
So that when the user searches using the Details section, they can query solr for
all the subject headings and their divisions.

This is needed for the Subject browse Vocabulary work.
example: "lc_subject_facet": [
             "Booksellers and bookselling—Italy—Directories",
             "Booksellers and bookselling-Italy",
             "Booksellers and bookselling"
              ]
Pull Request #2653: Add new lc_subject_facet field.

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

2215 existing lines in 93 files now uncovered.

1294 of 3804 relevant lines covered (34.02%)

0.99 hits per line

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

53.85
/app/models/ldap.rb
1
require 'net/ldap'
1✔
2

3
class Ldap
1✔
4
  class << self
1✔
5
    def find_by_netid(net_id, ldap_connection: default_connection)
1✔
UNCOV
6
      filter = Net::LDAP::Filter.eq('uid', net_id)
×
UNCOV
7
      result = ldap_connection.search(filter:).first
×
UNCOV
8
      return {} if result.blank?
×
9

UNCOV
10
      attributes(result)
×
11
    end
12

13
    private
1✔
14

15
      def attributes(result)
1✔
16
        {
UNCOV
17
          netid: result[:uid]&.first,
×
18
          department: result[:purescollege]&.first || result[:ou]&.first,
19
          address: result[:puinterofficeaddress]&.first,
20
          telephone: result[:telephonenumber]&.first,
21
          givenname: result[:givenname]&.first,
22
          surname: result[:sn]&.first,
23
          email: result[:mail]&.first,
24
          status: result[:edupersonprimaryaffiliation]&.first,
25
          pustatus: result[:pustatus]&.first,
26
          universityid: result[:universityid]&.first,
27
          title: result[:title]&.first
28
        }
29
      end
30

31
      def default_connection
1✔
32
        @default_connection ||= Net::LDAP.new host: 'ldap.princeton.edu', base: 'o=Princeton University,c=US', port: 636,
×
33
                                              encryption: {
34
                                                method: :simple_tls,
35
                                                tls_options: OpenSSL::SSL::SSLContext::DEFAULT_PARAMS
36
                                              }
37
      end
38
  end
39
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