Skip to content

Commit

Permalink
Remove hardcoding of SolrDocument in url_for_document
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Jun 27, 2018
1 parent ac2ad4a commit bdc707b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/blacklight/search_state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ def reset(params = nil)
# documents
def url_for_document(doc, options = {})
if respond_to?(:blacklight_config) &&
blacklight_config.show.route &&
(!doc.respond_to?(:to_model) || doc.to_model.is_a?(SolrDocument))
blacklight_config.show.route
route = blacklight_config.show.route.merge(action: :show, id: doc).merge(options)
route[:controller] = params[:controller] if route[:controller] == :current
route
Expand Down

0 comments on commit bdc707b

Please sign in to comment.