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

pulibrary / bibdata / f400817a-dbb4-4213-8c38-ea1927389f1a

01 Oct 2025 12:30PM UTC coverage: 90.779% (+1.1%) from 89.665%
f400817a-dbb4-4213-8c38-ea1927389f1a

push

circleci

christinach
Update CacheMap to look for the correct structure from figgy
Exclude resource types with no ark
and no resource_identifier(bibID)

related to [#1720]
related to [#1848]

4 of 28 new or added lines in 1 file covered. (14.29%)

4051 existing lines in 107 files now uncovered.

3229 of 3557 relevant lines covered (90.78%)

913.12 hits per line

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

84.38
/app/controllers/barcode_controller.rb
UNCOV
1
class BarcodeController < ApplicationController
1✔
UNCOV
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
UNCOV
6
  def scsb
1✔
UNCOV
7
    barcode = params[:barcode]
9✔
UNCOV
8
    if valid_barcode?(barcode)
9✔
UNCOV
9
      adapter = AlmaAdapter.new
8✔
UNCOV
10
      item = adapter.item_by_barcode(barcode)
8✔
UNCOV
11
      mms_id = item['bib_data']['mms_id']
6✔
UNCOV
12
      record = adapter.get_bib_record(mms_id, show_suppressed: true)
6✔
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?
6✔
16
        render plain: "Record #{mms_id} not found", status: :not_found
×
17
        return
×
UNCOV
18
      end
UNCOV
19
      holding = adapter.holding_by_id(mms_id:, holding_id: item.holding_data['holding_id'])
6✔
UNCOV
20
      records = if record.linked_record_ids.present?
5✔
UNCOV
21
                  adapter.get_bib_records(record.linked_record_ids)
1✔
UNCOV
22
                else
UNCOV
23
                  [record]
4✔
UNCOV
24
                end
UNCOV
25
      records.each do |bib_record|
5✔
UNCOV
26
        bib_record.enrich_with_item(item)
6✔
UNCOV
27
        bib_record.delete_conflicting_holding_data!
6✔
UNCOV
28
        bib_record.enrich_with_holding(holding, recap: true)
6✔
UNCOV
29
        bib_record.strip_non_numeric!
6✔
UNCOV
30
      end
UNCOV
31
      if records == []
5✔
32
        render plain: "Barcode #{barcode} not found.", status: :not_found
×
UNCOV
33
      else
UNCOV
34
        respond_to do |wants|
5✔
UNCOV
35
          wants.json  do
5✔
36
            json = MultiJson.dump(pass_records_through_xml_parser(records))
×
37
            render json:
×
UNCOV
38
          end
UNCOV
39
          wants.xml do
5✔
UNCOV
40
            xml = records_to_xml_string(records)
5✔
UNCOV
41
            render xml:
5✔
UNCOV
42
          end
UNCOV
43
        end
UNCOV
44
      end
UNCOV
45
    else
UNCOV
46
      render plain: "Barcode #{barcode} not valid.", status: :not_found
1✔
UNCOV
47
    end
UNCOV
48
  rescue StandardError => e
UNCOV
49
    handle_alma_exception(exception: e, message: "Error for barcode: #{barcode}")
3✔
UNCOV
50
  end
UNCOV
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

© 2026 Coveralls, Inc