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

pulibrary / orangelight / 00dbc10b-d747-4ad7-b211-7b26d753abbb

14 Aug 2025 01:25PM UTC coverage: 0.483% (-94.9%) from 95.343%
00dbc10b-d747-4ad7-b211-7b26d753abbb

push

circleci

web-flow
Merge pull request #5181 from pulibrary/dependabot/bundler/activestorage-7.2.2.2

Bump activestorage from 7.2.2.1 to 7.2.2.2

47 of 9721 relevant lines covered (0.48%)

0.01 hits per line

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

0.0
/app/models/requests/submissions/clancy.rb
1
# frozen_string_literal: true
2
require 'faraday'
×
3

4
module Requests::Submissions
×
5
  class Clancy < Service
×
6
    def initialize(submission)
×
7
      super(submission, service_type: 'clancy_in_library')
×
8
    end
×
9

10
    def handle
×
11
      items = @submission.filter_items_by_service(service_type)
×
12
      items.each do |item|
×
13
        handle_item(item)
×
14
      end
×
15
    end
×
16

17
    private
×
18

19
      def handle_item(item)
×
20
        # place the item on hold
21
        hold = Requests::Submissions::HoldItem.new(@submission, service_type: item["type"])
×
22
        hold.handle
×
23

24
        if hold.errors.empty?
×
25
          # request it from the clancy facility
26
          clancy_item = Requests::ClancyItem.new(barcode: item[:barcode])
×
27
          status = clancy_item.request?(patron: @submission.patron, hold_id: hold_id(item_barcode: item[:barcode], patron_barcode: @submission.patron.barcode))
×
28
          @errors << { type: 'clancy', error: clancy_item.errors.first, bibid: item[:bibid], barcode: item[:barcode] } unless status
×
29
        else
×
30
          @errors << hold.errors.first.merge(type: 'clancy_hold')
×
31
        end
×
32
      end
×
33

34
      def hold_id(item_barcode:, patron_barcode:)
×
35
        id = "#{item_barcode}-#{patron_barcode}-#{Time.zone.now.to_i}"
×
36
        Rails.logger.debug { "Requesting clancy item with id: #{id}" }
×
37
        id
×
38
      end
×
39
  end
×
40
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