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

curationexperts / laevigata / 2f4a3481-fc3c-44b3-b076-85704ed113e0

30 Jun 2025 09:14PM UTC coverage: 94.348% (-3.1%) from 97.411%
2f4a3481-fc3c-44b3-b076-85704ed113e0

Pull #2467

circleci

mark-dce
Remove deprecated calls to `Redis.current`

**ISSUE**
Our logs are being swamped with deprecation messages similar to:
```
`Redis.current` is deprecated and will be removed in 5.0.
  (called from: /Users/mark/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems
   /hyrax-2.9.6/lib/hyrax/redis_event_store.rb:26:in `instance')
```

**RESOLUTION**
Refactor the redis initilizer and override Hyrax class methods that
call `Redis.current` in favor of a memoized call to `Redis.new`

**REFERENCES**
This commit was heavily influenced by
https://github.com/samvera/hyrax/commit/50cc8f0f
Pull Request #2467: Remove deprecated calls to `Redis.current`

17 of 17 new or added lines in 4 files covered. (100.0%)

193 existing lines in 28 files now uncovered.

2704 of 2866 relevant lines covered (94.35%)

52.91 hits per line

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

91.3
/app/controllers/application_controller.rb
1
class ApplicationController < ActionController::Base
4✔
2
  helper Openseadragon::OpenseadragonHelper
4✔
3
  # Adds a few additional behaviors into the application controller
4
  include Blacklight::Controller
4✔
5
  skip_after_action :discard_flash_if_xhr
4✔
6
  include Hydra::Controller::ControllerBehavior
4✔
7

8
  # Adds Hyrax behaviors into the application controller
9
  include Hyrax::Controller
4✔
10
  include Hyrax::ThemedLayoutController
4✔
11
  include HttpAuthConcern
4✔
12

13
  # Check to see if we're in read_only mode
14
  before_action :check_read_only, except: [:show, :index]
4✔
15

16
  with_themed_layout '1_column'
4✔
17

18
  protect_from_forgery with: :exception
4✔
19

20
  # What to do if read_only mode has been enabled, via FlipFlop
21
  # If read_only is enabled, redirect any requests that would allow
22
  # changes to the system. This is to enable easier migrations.
23
  def check_read_only
4✔
24
    return unless Flipflop.read_only?
80✔
25
    # Exempt the FlipFlop controller itself from read_only mode, so it can be turned off
UNCOV
26
    return if self.class.to_s == Hyrax::Admin::StrategiesController.to_s
2✔
UNCOV
27
    redirect_back(
2✔
28
      fallback_location: root_path,
29
      alert: "This system is in read-only mode for maintenance. No submissions or edits can be made at this time."
30
    )
31
  end
32

33
  # Override from Hyrax
34
  # Provide a place for Devise to send the user to after signing in
35
  # Send newly signed in users to the main screen
36
  def user_root_path
4✔
37
    root_path
×
38
  end
39

40
  rescue_from ActionController::RoutingError do |exception|
4✔
41
    render plain: '404 Not found', status: 404
×
42
  end
43

44
  private
4✔
45

46
  def append_info_to_payload(payload)
4✔
47
    super
238✔
48
    payload[:request_id] = request.request_id
238✔
49
  end
50
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