• 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/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
UNCOV
5
class SubmissionSerializer < ActiveJob::Serializers::ObjectSerializer
×
UNCOV
6
  def serialize(submission)
×
7
    patron = submission.patron
×
8
    user = patron.user
×
9
    super(
×
UNCOV
10
      'patron' => {
×
UNCOV
11
        'user' => {
×
UNCOV
12
          'uid' => user.uid,
×
UNCOV
13
          'username' => user.username,
×
UNCOV
14
          'guest' => user.guest,
×
UNCOV
15
          'provider' => user.provider
×
UNCOV
16
        },
×
UNCOV
17
        'patron_hash' => patron.patron_hash
×
UNCOV
18
      },
×
UNCOV
19
      'items' => submission.items,
×
UNCOV
20
      'bib' => submission.bib,
×
UNCOV
21
      'services' => [],
×
UNCOV
22
      'success_messages' => []
×
UNCOV
23
    )
×
UNCOV
24
  end
×
25

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

UNCOV
39
  private
×
40

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