• 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/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