• 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

9.38
/app/controllers/barcode_controller.rb
1
class BarcodeController < ApplicationController
1✔
2
  include FormattingConcern
1✔
3

4
  # Client: This endpoint is used by the ReCAP inventory management system, LAS,
5
  #   to pull data from our ILS when items are accessioned
6
  def scsb
1✔
UNCOV
7
    barcode = params[:barcode]
×
UNCOV
8
    if valid_barcode?(barcode)
×
UNCOV
9
      adapter = AlmaAdapter.new
×
UNCOV
10
      item = adapter.item_by_barcode(barcode)
×
UNCOV
11
      mms_id = item['bib_data']['mms_id']
×
UNCOV
12
      record = adapter.get_bib_record(mms_id, show_suppressed: true)
×
13

14
      # If the bib record is not found, the returned record will be nil and the controller should return with a 404 status
UNCOV
15
      if record.nil?
×
16
        render plain: "Record #{mms_id} not found", status: :not_found
×
17
        return
×
18
      end
UNCOV
19
      holding = adapter.holding_by_id(mms_id:, holding_id: item.holding_data['holding_id'])
×
UNCOV
20
      records = if record.linked_record_ids.present?
×
UNCOV
21
                  adapter.get_bib_records(record.linked_record_ids)
×
22
                else
UNCOV
23
                  [record]
×
24
                end
UNCOV
25
      records.each do |bib_record|
×
UNCOV
26
        bib_record.enrich_with_item(item)
×
UNCOV
27
        bib_record.delete_conflicting_holding_data!
×
UNCOV
28
        bib_record.enrich_with_holding(holding, recap: true)
×
UNCOV
29
        bib_record.strip_non_numeric!
×
30
      end
UNCOV
31
      if records == []
×
32
        render plain: "Barcode #{barcode} not found.", status: :not_found
×
33
      else
UNCOV
34
        respond_to do |wants|
×
UNCOV
35
          wants.json  do
×
36
            json = MultiJson.dump(pass_records_through_xml_parser(records))
×
37
            render json:
×
38
          end
UNCOV
39
          wants.xml do
×
UNCOV
40
            xml = records_to_xml_string(records)
×
UNCOV
41
            render xml:
×
42
          end
43
        end
44
      end
45
    else
UNCOV
46
      render plain: "Barcode #{barcode} not valid.", status: :not_found
×
47
    end
48
  rescue StandardError => e
UNCOV
49
    handle_alma_exception(exception: e, message: "Error for barcode: #{barcode}")
×
50
  end
51
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