• 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

100.0
/app/validators/my_program_validator.rb
1
class MyProgramValidator < ActiveModel::Validator
4✔
2
  def validate(record)
4✔
3
    return unless current_tab?(record)
91✔
UNCOV
4
    fields_to_validate = ::Hyrax::EtdForm.my_program_terms - [:partnering_agency]
3✔
UNCOV
5
    fields_to_validate.each do |field|
3✔
6
      # TODO: confirm whether subfields are never required by Emory
UNCOV
7
      next if field == :subfield
12✔
UNCOV
8
      record.errors.add(field, "#{field} is required") if parsed_data(record)[field.to_s].blank?
9✔
9
    end
10
  end
11

12
  def parsed_data(record)
4✔
13
    return {} unless record.data
100✔
14
    JSON.parse(record.data)
74✔
15
  end
16

17
  def current_tab?(record)
4✔
18
    parsed_data(record)['currentTab'] == "My Program"
91✔
19
  end
20
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