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

pulibrary / orangelight / 1012abf7-10f8-4d5d-85a8-14d187ffcf80

29 Oct 2024 05:09PM UTC coverage: 96.866% (-0.01%) from 96.877%
1012abf7-10f8-4d5d-85a8-14d187ffcf80

push

circleci

sandbergja
[#4472] Provide an abstraction of SearchService#fetch

This method from the search service has a different API in Blacklight 7 vs.
Blacklight 8.  This commit provides a small abstraction that checks whether
we are using Blacklight 7 or 8, and then uses the appropriate API.

Closes #4472

10 of 11 new or added lines in 3 files covered. (90.91%)

6120 of 6318 relevant lines covered (96.87%)

1548.31 hits per line

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

88.89
/app/services/retrieve_record_service.rb
1
# We can remove this service (and just call search_service.fetch directly)
2
# after we migrate to Blacklight 8
3
class RetrieveRecordService
3✔
4
  def retrieve(search_service, ...)
3✔
5
    if using_blacklight7?
7✔
6
        _response, document = search_service.fetch(...)
7✔
7
        document
6✔
8
    else
NEW
9
        search_service.fetch(...)
×
10
    end
11
  end
12

13
  private
3✔
14

15
  def using_blacklight7?
3✔
16
    Gem.loaded_specs['blacklight'].version.to_s.start_with? '7'
7✔
17
  end
18
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