• 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/service_eligibility/ill.rb
1
# frozen_string_literal: true
2
module Requests
×
3
  module ServiceEligibility
×
4
    # This class is responsible for determining if a specific
5
    # user can request a specific resource via ILL
6
    class ILL
×
7
      def initialize(requestable:, patron:, any_loanable:)
×
8
        @requestable = requestable
×
9
        @user = patron.user
×
10
        @any_loanable = any_loanable
×
11
        @patron = patron
×
12
      end
×
13

14
      def to_s
×
15
        'ill'
×
16
      end
×
17

18
      def eligible?
×
19
        requestable_eligible? && user_eligible? && patron_group_eligible?
×
20
      end
×
21

22
        private
×
23

24
          def requestable_eligible?
×
25
            !requestable.aeon? && requestable.charged? && !requestable.marquand_item? &&
×
26
              (!any_loanable || requestable.enumerated? || requestable.preservation_conservation?)
×
27
          end
×
28

29
          def user_eligible?
×
30
            user.cas_provider? || user.alma_provider?
×
31
          end
×
32

33
          def patron_group_eligible?
×
34
            allowed_patron_groups.include?(patron.patron_group)
×
35
          end
×
36

37
          def allowed_patron_groups
×
38
            @allowed_patron_groups ||= %w[P REG GRAD SENR UGRD]
×
39
          end
×
40

41
          attr_reader :requestable, :user, :any_loanable, :patron
×
42
    end
×
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