• 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/submissions/service.rb
1
# frozen_string_literal: true
UNCOV
2
module Requests::Submissions
×
UNCOV
3
  class Service
×
UNCOV
4
    attr_reader :service_type, :success_message, :submission, :errors, :sent
×
5

UNCOV
6
    def initialize(submission, service_type:)
×
UNCOV
7
      @submission = submission
×
UNCOV
8
      @sent = [] # array of hashes of bibid and item_ids for each successfully sent item
×
UNCOV
9
      @errors = [] # array of hashes with bibid and item_id and error message
×
UNCOV
10
      @service_type = service_type
×
UNCOV
11
      @success_message = I18n.t("requests.submit.#{service_type}_success", default: I18n.t('requests.submit.success'))
×
UNCOV
12
    end
×
13

UNCOV
14
    def handle
×
15
      raise NotImplementedError
×
UNCOV
16
    end
×
17

UNCOV
18
    def submitted
×
UNCOV
19
      @sent
×
UNCOV
20
    end
×
21

22
    # This has to be a utility function to prevent ActiveJob from trying to serialize too many objects
23
    # :reek:UtilityFunction
UNCOV
24
    def send_mail
×
UNCOV
25
      return if errors.present?
×
UNCOV
26
      hashed_submission = submission.to_h # Sidekiq will only accept a hash, not a Requests::Submission object
×
UNCOV
27
      Requests::RequestMailer.send("#{service_type}_email", hashed_submission).deliver_later
×
UNCOV
28
      Requests::RequestMailer.send("#{service_type}_confirmation", hashed_submission).deliver_later
×
UNCOV
29
    end
×
30

UNCOV
31
    def error_hash
×
UNCOV
32
      errors = @errors.map { |error| { type: error[:type], error: error[:error], bibid: error[:bibid], barcode: error[:barcode], reply_text: error[:reply_text] } }
×
UNCOV
33
      [[@service_type, errors]].to_h
×
UNCOV
34
    end
×
UNCOV
35
  end
×
UNCOV
36
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