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

pulibrary / orangelight / 62bad3f1-d46d-40af-822c-403d653da2a8

17 Jun 2025 05:30PM UTC coverage: 0.447% (-94.9%) from 95.337%
62bad3f1-d46d-40af-822c-403d653da2a8

push

circleci

maxkadel
Install chrome & chromedriver for smoke specs

43 of 9610 relevant lines covered (0.45%)

0.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/app/serializers/submission_serializer.rb
1
# frozen_string_literal: true
2

3
# This class serializes and deserializes the Submission
4
# object so it can be used in ActiveJob queues
5
class SubmissionSerializer < ActiveJob::Serializers::ObjectSerializer
×
6
  def serialize(submission)
×
7
    patron = submission.patron
×
8
    user = patron.user
×
9
    super(
×
10
      'patron' => {
×
11
        'user' => {
×
12
          'uid' => user.uid,
×
13
          'username' => user.username,
×
14
          'guest' => user.guest,
×
15
          'provider' => user.provider
×
16
        },
×
17
        'patron_hash' => patron.patron_hash
×
18
      },
×
19
      'items' => submission.items,
×
20
      'bib' => submission.bib,
×
21
      'services' => [],
×
22
      'success_messages' => []
×
23
    )
×
24
  end
×
25

26
  # This method is required to implement the ActiveJob::Serializer::ObjectSerializer
27
  # :reek:UtilityFunction
28
  def deserialize(hash)
×
29
    user_hash = hash.dig('patron', 'user')
×
30
    user = User.from_hash(user_hash)
×
31
    params = {
×
32
      requestable: hash['items'],
×
33
      bib: hash['bib']
×
34
    }
×
35
    patron = Requests::Patron.new(user:, patron_hash: hash.dig('patron', 'patron_hash'))
×
36
    Requests::Submission.new(params, patron)
×
37
  end
×
38

39
  private
×
40

41
    def klass
×
42
      Requests::Submission
×
43
    end
×
44
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