• 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

35.29
/marc_to_solr/lib/embargo_date_extractor.rb
1
class EmbargoDateExtractor
1✔
2
  def initialize(record)
1✔
UNCOV
3
    @record = record
×
4
  end
5

6
  def dates
1✔
UNCOV
7
    @dates ||= extract_dates
×
8
  end
9

10
  private
1✔
11

12
    def extract_dates
1✔
UNCOV
13
      restriction_notes = @record.select do |field|
×
UNCOV
14
        field.tag == '506' &&
×
UNCOV
15
          field.any? { |subfield| subfield.code == '5' && subfield.value == 'NjP' } &&
×
UNCOV
16
          field.any? { |subfield| subfield.code == 'g' }
×
17
      end
UNCOV
18
      restriction_notes.map { |field| parse_date(field['g']) }.compact
×
19
    end
20

21
    def parse_date(string)
1✔
UNCOV
22
      year = string[0..3].to_i
×
UNCOV
23
      month = string[4..5].to_i
×
UNCOV
24
      day = string[6..7].to_i
×
UNCOV
25
      Date.new(year, month, day) if Date.valid_date?(year, month, day)
×
26
    end
27
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