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

pulibrary / orangelight / 0e37073d-109c-440c-949f-49d2aa86311b

18 Aug 2025 09:05PM UTC coverage: 0.482% (-94.9%) from 95.343%
0e37073d-109c-440c-949f-49d2aa86311b

push

circleci

web-flow
Replace per_page_options_for_select with custom component to avoid deprecation issue (#5186)

* Start creating new component to address deprecaton warning

* Replace per_page_options_for_select with custom component to avoid deprecation issue

Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>

---------

Co-authored-by: Ryan Jensen <rj1044@princeton.edu>
Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>

0 of 33 new or added lines in 1 file covered. (0.0%)

9374 existing lines in 213 files now uncovered.

47 of 9753 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/aeon_url.rb
1
# frozen_string_literal: true
UNCOV
2
module Requests
×
3
  # Create a URL that creates an aeon request
UNCOV
4
  class AeonUrl
×
5
    # @param document [SolrDocument]
6
    # @param holding [Hash]
7
    # @param item [Requests::Item]
UNCOV
8
    def initialize(document:, holding: nil, item: nil)
×
UNCOV
9
      @document = document
×
UNCOV
10
      @holding = holding.values.first if holding
×
UNCOV
11
      @item = item if item
×
UNCOV
12
    end
×
13

UNCOV
14
    def to_s
×
UNCOV
15
      aeon_url = Requests.config[:aeon_base]
×
UNCOV
16
      aeon_connector = "?Action=10&Form=30&"
×
UNCOV
17
      @compiled_string ||= "#{aeon_url}#{aeon_connector}#{query_string}"
×
UNCOV
18
    end
×
19

UNCOV
20
    private
×
21

UNCOV
22
      attr_reader :document
×
23

UNCOV
24
      def query_string
×
UNCOV
25
        "#{ctx_with_item_info.kev}&#{aeon_basic_params.to_query}"
×
UNCOV
26
      end
×
27

UNCOV
28
      def ctx_with_item_info
×
UNCOV
29
        ctx = @document.to_ctx
×
UNCOV
30
        if item.present?
×
UNCOV
31
          ctx.referent.set_metadata('iteminfo5', item['id']&.to_s)
×
UNCOV
32
          if item.enum_value.present?
×
UNCOV
33
            ctx.referent.set_metadata('volume', item.enum_value)
×
UNCOV
34
            ctx.referent.set_metadata('issue', item[:chron_display]) if item[:chron_display].present?
×
UNCOV
35
          else
×
UNCOV
36
            ctx.referent.set_metadata('volume', holding['location_has']&.first)
×
UNCOV
37
            ctx.referent.set_metadata('issue', nil)
×
UNCOV
38
          end
×
UNCOV
39
        end
×
UNCOV
40
        ctx
×
UNCOV
41
      end
×
42

UNCOV
43
      def aeon_basic_params
×
UNCOV
44
        {
×
UNCOV
45
          ReferenceNumber: @document[:id],
×
UNCOV
46
          CallNumber: holding['call_number'],
×
UNCOV
47
          Site: site,
×
UNCOV
48
          Location: shelf_location_code,
×
UNCOV
49
          SubLocation: sub_location,
×
UNCOV
50
          ItemInfo1: document['access_restrictions_note_display']&.first || I18n.t("requests.aeon.access_statement"),
×
UNCOV
51
          ItemNumber: item&.barcode,
×
UNCOV
52
          'rft.aucorp': document['pub_citation_display']&.first
×
UNCOV
53
        }.compact
×
UNCOV
54
      end
×
55

UNCOV
56
      def holding
×
UNCOV
57
        @holding ||= @document.holdings_all_display.values.first
×
UNCOV
58
      end
×
59

UNCOV
60
      def item
×
UNCOV
61
        @item ||= item_from_holding || item_from_document || Item.new({})
×
UNCOV
62
      end
×
63

UNCOV
64
      def item_from_holding
×
UNCOV
65
        item_hash = holding&.fetch('items', nil)&.first
×
UNCOV
66
        Item.new(item_hash.with_indifferent_access) if item_hash
×
UNCOV
67
      end
×
68

UNCOV
69
      def item_from_document
×
UNCOV
70
        item_hash = @document.holdings_all_display.values.first&.fetch('items', nil)&.first
×
UNCOV
71
        Item.new(item_hash.with_indifferent_access) if item_hash
×
UNCOV
72
      end
×
73

UNCOV
74
      def at_marquand?
×
UNCOV
75
        holding_location&.dig('library', 'code') == 'marquand'
×
UNCOV
76
      end
×
77

UNCOV
78
      def at_mudd?
×
UNCOV
79
        holding_location&.dig('library', 'code') == 'mudd' || thesis?
×
UNCOV
80
      end
×
81

UNCOV
82
      def holding_location
×
UNCOV
83
        ::Bibdata.holding_locations.fetch(shelf_location_code, nil)
×
UNCOV
84
      end
×
85

UNCOV
86
      def shelf_location_code
×
UNCOV
87
        holding&.fetch('location_code', nil)
×
UNCOV
88
      end
×
89

UNCOV
90
      def sub_location
×
UNCOV
91
        holding&.fetch('sub_location', nil)&.first
×
UNCOV
92
      end
×
93

UNCOV
94
      def thesis?
×
UNCOV
95
        @document.holdings_all_display&.keys&.first == "thesis"
×
UNCOV
96
      end
×
97

UNCOV
98
      def site
×
UNCOV
99
        return 'MUDD' if at_mudd?
×
UNCOV
100
        return 'MARQ' if at_marquand?
×
UNCOV
101
        'FIRE'
×
UNCOV
102
      end
×
UNCOV
103
  end
×
UNCOV
104
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