Skip to content

Commit

Permalink
Merge pull request #122 from projectblacklight/deprecation-warning
Browse files Browse the repository at this point in the history
Using DeprecatedConstantProxy without a Deprecator is deprecated
  • Loading branch information
jcoyne authored Aug 19, 2024
2 parents fabd8f7 + 588839c commit 2c2b92a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/controllers/concerns/blacklight/marc/catalog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ module Catalog
end

def librarian_view
deprecator = ActiveSupport::Deprecation.new
if Blacklight::VERSION >= '8'
@document = search_service.fetch(params[:id])
@response = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(@document.response, "The @response instance variable is deprecated and will be removed in Blacklight-marc 8.0")
@response = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(@document.response, "The @response instance variable is deprecated and will be removed in Blacklight-marc 8.0", deprecator)

else
deprecated_response, @document = search_service.fetch(params[:id])
@response = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(deprecated_response, "The @response instance variable is deprecated and will be removed in Blacklight-marc 8.0")
@response = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(deprecated_response, "The @response instance variable is deprecated and will be removed in Blacklight-marc 8.0", deprecator)
end

respond_to do |format|
Expand Down

0 comments on commit 2c2b92a

Please sign in to comment.