Skip to content

Commit

Permalink
add Hyrax::Controller#repository
Browse files Browse the repository at this point in the history
Blacklight 6 makes `#repository` available on each controller. Blacklight 7
removes this.

Probably, Hyrax shouldn't be depending on `#repository` directly? but until we
can do whatever it is Blacklight 7 prefers, shim in a compatibility layer.
  • Loading branch information
tamsin johnson committed Dec 11, 2021
1 parent b971747 commit 497eeec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/controllers/concerns/hyrax/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ def default_url_options
super.merge(locale: I18n.locale)
end

##
# @deprecated provides short-term compatibility with Blacklight 6
# @return [Blacklight::AbstractRepository]
def repository
return super if defined?(super)
Deprecation.warn("Avoid direct calls to `#repository`; this method" \
" provides short-term compatibility to Blacklight 6 " \
" clients.")
blacklight_config.repository
end

private

##
Expand Down

0 comments on commit 497eeec

Please sign in to comment.