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

pulibrary / bibdata / 03936b48-38dc-426c-afe8-57993b6e85af

27 Jan 2026 10:01PM UTC coverage: 55.504% (-34.7%) from 90.159%
03936b48-38dc-426c-afe8-57993b6e85af

push

circleci

christinach
Add custom implementation of Deserialize in origin_place and coverage
If pref_label is missing then defalt to an empty string
If the exact_match exists and it has the wrong structure it returns None instead of erroring

related to [#3020]

80 of 81 new or added lines in 4 files covered. (98.77%)

4044 existing lines in 108 files now uncovered.

6288 of 11329 relevant lines covered (55.5%)

11.64 hits per line

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

0.0
/app/controllers/barcode_controller.rb
UNCOV
1
class BarcodeController < ApplicationController
×
UNCOV
2
  include FormattingConcern
×
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
×
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
×
UNCOV
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)
×
UNCOV
22
                else
×
UNCOV
23
                  [record]
×
UNCOV
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!
×
UNCOV
30
      end
×
UNCOV
31
      if records == []
×
32
        render plain: "Barcode #{barcode} not found.", status: :not_found
×
UNCOV
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:
×
UNCOV
38
          end
×
UNCOV
39
          wants.xml do
×
UNCOV
40
            xml = records_to_xml_string(records)
×
UNCOV
41
            render xml:
×
UNCOV
42
          end
×
UNCOV
43
        end
×
UNCOV
44
      end
×
UNCOV
45
    else
×
UNCOV
46
      render plain: "Barcode #{barcode} not valid.", status: :not_found
×
UNCOV
47
    end
×
UNCOV
48
  rescue StandardError => e
×
UNCOV
49
    handle_alma_exception(exception: e, message: "Error for barcode: #{barcode}")
×
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