• 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/item.rb
1
# frozen_string_literal: true
UNCOV
2
module Requests
×
UNCOV
3
  class Item < SimpleDelegator
×
UNCOV
4
    def pick_up_location_code
×
UNCOV
5
      self['pickup_location_code'] || ""
×
UNCOV
6
    end
×
7

UNCOV
8
    def item_type
×
UNCOV
9
      self['item_type'] || ""
×
UNCOV
10
    end
×
11

UNCOV
12
    def description
×
UNCOV
13
      self[:description] || enum_value
×
UNCOV
14
    end
×
15

UNCOV
16
    def enum_value
×
UNCOV
17
      (short_description_from_alma_availability_call || long_description).to_s.strip
×
UNCOV
18
    end
×
19

UNCOV
20
    def cron_value
×
UNCOV
21
      self['chron_display'] || ""
×
UNCOV
22
    end
×
23

UNCOV
24
    def copy_number
×
UNCOV
25
      self[:copy_number] || ""
×
UNCOV
26
    end
×
27

UNCOV
28
    def copy_value
×
UNCOV
29
      @copy_value ||= if self[:copy_number].present? && self[:copy_number].to_i != 0 && self[:copy_number].to_i != 1
×
UNCOV
30
                        "Copy #{self[:copy_number]}"
×
UNCOV
31
                      else
×
UNCOV
32
                        ""
×
UNCOV
33
                      end
×
UNCOV
34
      @copy_value
×
UNCOV
35
    end
×
36

UNCOV
37
    def item_data?
×
UNCOV
38
      self[:id].present?
×
UNCOV
39
    end
×
40

UNCOV
41
    def temp_loc?
×
UNCOV
42
      self[:in_temp_library]
×
UNCOV
43
    end
×
44

UNCOV
45
    def in_resource_sharing?
×
UNCOV
46
      self[:temp_location_code] == "RES_SHARE$IN_RS_REQ"
×
UNCOV
47
    end
×
48

UNCOV
49
    def temp_loc_other_than_resource_sharing?
×
UNCOV
50
      temp_loc? && !in_resource_sharing?
×
UNCOV
51
    end
×
52

UNCOV
53
    def on_reserve?
×
UNCOV
54
      self[:on_reserve] == 'Y'
×
UNCOV
55
    end
×
56

UNCOV
57
    def preservation_conservation?
×
UNCOV
58
      status_label == "Preservation and Conservation"
×
UNCOV
59
    end
×
60

UNCOV
61
    def enumerated?
×
UNCOV
62
      enum_value.present?
×
UNCOV
63
    end
×
64

UNCOV
65
    def item_type_non_circulate?
×
UNCOV
66
      ['NoCirc', 'Closed', 'Res-No'].include? item_type
×
UNCOV
67
    end
×
68

UNCOV
69
    def id
×
UNCOV
70
      self['id']
×
UNCOV
71
    end
×
72

UNCOV
73
    def use_statement
×
UNCOV
74
      self[:use_statement]
×
UNCOV
75
    end
×
76

UNCOV
77
    def collection_code
×
UNCOV
78
      self[:collection_code]
×
UNCOV
79
    end
×
80

UNCOV
81
    def charged?
×
UNCOV
82
      unavailable_statuses.include?(status_label)
×
UNCOV
83
    end
×
84

UNCOV
85
    def status
×
86
      # SCSB still returns a status of "Not Available", which we should change to "Unavailable"
UNCOV
87
      return self[:status] if self[:status].present? && self[:status] != "Not Available"
×
UNCOV
88
      if available?
×
UNCOV
89
        "Available"
×
UNCOV
90
      else
×
UNCOV
91
        "Unavailable"
×
UNCOV
92
      end
×
UNCOV
93
    end
×
94

UNCOV
95
    def status_label
×
UNCOV
96
      self[:status_label]
×
UNCOV
97
    end
×
98

UNCOV
99
    def not_a_work_order?
×
UNCOV
100
      self[:status_source] != "work_order"
×
UNCOV
101
    end
×
102

UNCOV
103
    def available?
×
UNCOV
104
      available_statuses.include?(status_label)
×
UNCOV
105
    end
×
106

UNCOV
107
    def barcode?
×
UNCOV
108
      /^[0-9]+/.match(barcode).present?
×
UNCOV
109
    end
×
110

UNCOV
111
    def barcode
×
UNCOV
112
      self[:barcode]
×
UNCOV
113
    end
×
114

UNCOV
115
    def partner_holding?
×
UNCOV
116
      Requests.config[:recap_partner_locations].key?(self["location_code"])
×
UNCOV
117
    end
×
118

119
    # The location code (e.g. firestone$pf)
UNCOV
120
    def location
×
UNCOV
121
      self[:location]
×
UNCOV
122
    end
×
123

UNCOV
124
    private
×
125

UNCOV
126
      def short_description_from_alma_availability_call
×
UNCOV
127
        self[:enum_display]
×
UNCOV
128
      end
×
129

UNCOV
130
      def long_description
×
UNCOV
131
        self[:description]
×
UNCOV
132
      end
×
133

UNCOV
134
      def available_statuses
×
UNCOV
135
        scsb = ["Available"]
×
UNCOV
136
        alma = ['Item in place']
×
UNCOV
137
        scsb + alma
×
UNCOV
138
      end
×
139

UNCOV
140
      def unavailable_statuses
×
UNCOV
141
        scsb = ['Not Available', "Item Barcode doesn't exist in SCSB database."]
×
UNCOV
142
        alma = ['Unavailable', 'Claimed Returned', 'Lost', 'Hold Shelf', 'Transit', 'Missing', 'Resource Sharing Request',
×
UNCOV
143
                'Lost Resource Sharing Item', 'Requested', 'In Transit to Remote Storage', 'Lost and paid',
×
UNCOV
144
                'Loan', 'At Preservation', 'Technical - Migration', 'Preservation and Conservation',
×
UNCOV
145
                'Collection Development Office', 'Holdings Management']
×
UNCOV
146
        scsb + alma
×
UNCOV
147
      end
×
UNCOV
148
  end
×
UNCOV
149
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