• 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/controllers/application_controller.rb
1
# frozen_string_literal: true
2

UNCOV
3
class ApplicationController < ActionController::Base
×
4
  # Adds a few additional behaviors into the application controller
UNCOV
5
  include Blacklight::Controller
×
6

7
  # Please be sure to impelement current_user and user_session. Blacklight depends on
8
  # these methods in order to perform user specific actions.
9

UNCOV
10
  layout 'application'
×
11

12
  # Prevent CSRF attacks by raising an exception.
13
  # For APIs, you may want to use :null_session instead.
UNCOV
14
  protect_from_forgery with: :exception
×
15

UNCOV
16
  def after_sign_in_path_for(resource)
×
UNCOV
17
    stored_location = stored_location_for(resource)
×
UNCOV
18
    if referrer.present? && referrer.exclude?("sign_in") && !origin&.include?("redirect-to-alma")
×
UNCOV
19
      referrer
×
UNCOV
20
    elsif origin.present?
×
UNCOV
21
      request.flash.delete('alert')
×
UNCOV
22
      request.flash.keep('notice')
×
UNCOV
23
      origin.chomp('/email')
×
UNCOV
24
    elsif !request.env['omniauth.origin'].nil? &&
×
UNCOV
25
          /request|borrow-direct|email|bookmarks|search_history|redirect-to-alma/.match(request.env['omniauth.origin'])
×
UNCOV
26
      referrer_from_url(request.env['omniauth.origin'])
×
UNCOV
27
    elsif stored_location.present?
×
UNCOV
28
      stored_location
×
UNCOV
29
    else
×
UNCOV
30
      account_path
×
UNCOV
31
    end
×
UNCOV
32
  end
×
33

UNCOV
34
  def referrer
×
UNCOV
35
    @referrer ||= params[:url] || request.referer
×
UNCOV
36
  end
×
37

UNCOV
38
  def origin
×
UNCOV
39
    @origin ||= begin
×
UNCOV
40
      return params[:origin] if params[:origin].present?
×
41

UNCOV
42
      if referrer.present? && referrer.include?("origin")
×
UNCOV
43
        referrer_params = Rack::Utils.parse_query URI.parse(referrer).query
×
UNCOV
44
        return referrer_params["origin"]
×
UNCOV
45
      end
×
UNCOV
46
    end
×
UNCOV
47
  end
×
48

UNCOV
49
  def after_sign_out_path_for(resource)
×
UNCOV
50
    if resource == 'barcode' || resource == "alma"
×
UNCOV
51
      root_url
×
UNCOV
52
    else
×
UNCOV
53
      Rails.configuration.x.after_sign_out_url
×
UNCOV
54
    end
×
UNCOV
55
  end
×
56

UNCOV
57
  def default_url_options
×
UNCOV
58
    Rails.env.production? || Rails.env.staging? ? { protocol: 'https' } : {}
×
UNCOV
59
  end
×
60

UNCOV
61
  private
×
62

UNCOV
63
    def verify_admin!
×
UNCOV
64
      authenticate_user!
×
UNCOV
65
      head :forbidden unless current_user.admin?
×
UNCOV
66
    end
×
67

UNCOV
68
    def referrer_from_url(url)
×
UNCOV
69
      query = URI.parse(url).query
×
UNCOV
70
      if query
×
UNCOV
71
        CGI.parse(query).try(:[], "referer")&.first
×
UNCOV
72
      else
×
UNCOV
73
        url
×
UNCOV
74
      end
×
UNCOV
75
    end
×
76

UNCOV
77
    before_action do
×
UNCOV
78
      Rack::MiniProfiler.authorize_request if current_user&.admin?
×
UNCOV
79
    end
×
UNCOV
80
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

© 2026 Coveralls, Inc