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

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

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

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

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

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