• 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/illiad_metadata/loan.rb
1
# frozen_string_literal: true
UNCOV
2
module Requests
×
UNCOV
3
  module IlliadMetadata
×
UNCOV
4
    class Loan
×
UNCOV
5
      attr_reader :patron, :bib, :item, :note, :illiad_transaction_status, :attributes
×
6

UNCOV
7
      def initialize(patron:, bib:, item:, note: "Loan Request")
×
UNCOV
8
        @patron = patron
×
UNCOV
9
        @bib = bib
×
UNCOV
10
        @item = item
×
UNCOV
11
        @note = note&.truncate(4000)
×
UNCOV
12
        @illiad_transaction_status = "Awaiting Request Processing"
×
UNCOV
13
        @attributes = map_metdata
×
UNCOV
14
      end
×
15

UNCOV
16
      private
×
17

UNCOV
18
        def map_metdata
×
UNCOV
19
          {
×
UNCOV
20
            "Username" => patron.netid, "TransactionStatus" => illiad_transaction_status,
×
UNCOV
21
            "RequestType" => "Loan", "ProcessType" => "Borrowing", "NotWantedAfter" => (DateTime.current + 6.months).strftime("%m/%d/%Y"),
×
UNCOV
22
            "WantedBy" => "Yes, until the semester's", # NOTE: creation fails if we use any other text value
×
UNCOV
23
            "LoanAuthor" => bib["author"]&.truncate(100), "LoanTitle" => bib["title"]&.truncate(255),
×
UNCOV
24
            "LoanPublisher" => item["edd_publisher"]&.truncate(40), "LoanDate" => bib["date"],
×
UNCOV
25
            "ISSN" => bib["isbn"], "CallNumber" => call_number(item),
×
UNCOV
26
            "CitedIn" => "#{Requests.config[:pulsearch_base]}/catalog/#{bib['id']}",
×
UNCOV
27
            "ItemInfo3" => volume_number(item)&.truncate(255), "ItemInfo4" => item["edd_issue"]&.truncate(255),
×
UNCOV
28
            "AcceptNonEnglish" => true, "ESPNumber" => item["edd_oclc_number"]&.truncate(32),
×
UNCOV
29
            "DocumentType" => genre, "LoanPlace" => item["edd_location"]
×
UNCOV
30
          }
×
UNCOV
31
        end
×
32

UNCOV
33
        def genre
×
UNCOV
34
          case item["edd_genre"]
×
UNCOV
35
          when "article"
×
36
            "Article"
×
UNCOV
37
          when "bookitem"
×
38
            "Book Chapter"
×
UNCOV
39
          when "dissertation"
×
40
            "Thesis"
×
UNCOV
41
          else
×
UNCOV
42
            "Book"
×
UNCOV
43
          end
×
UNCOV
44
        end
×
45

UNCOV
46
        def volume_number(item)
×
UNCOV
47
          vol = [item["user_supplied_enum"], item["edd_volume_number"], item["enum"]].compact_blank
×
UNCOV
48
          vol.join(', ')&.truncate(30)
×
UNCOV
49
        end
×
50

UNCOV
51
        def call_number(item)
×
UNCOV
52
          call_no = item["edd_call_number"] || item["call_number"]
×
UNCOV
53
          call_no&.truncate(255)
×
UNCOV
54
        end
×
UNCOV
55
    end
×
UNCOV
56
  end
×
UNCOV
57
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