From e120c987e0081da7918f8a2d154e61e14731b3c0 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Mon, 4 Jan 2016 10:25:48 -0600 Subject: [PATCH] Operate on the instance variable --- app/helpers/blacklight/url_helper_behavior.rb | 3 +-- lib/blacklight/search_state.rb | 2 +- spec/support/controller_level_helpers.rb | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/helpers/blacklight/url_helper_behavior.rb b/app/helpers/blacklight/url_helper_behavior.rb index 1c2d28c27f..82e4c57dd2 100644 --- a/app/helpers/blacklight/url_helper_behavior.rb +++ b/app/helpers/blacklight/url_helper_behavior.rb @@ -92,8 +92,7 @@ def controller_tracking_method def link_to_query(query) p = search_state.to_h.except(:page, :action) p[:q] = query - link_url = search_action_path(p.to_h) - link_to(query, link_url) + link_to(query, search_action_path(p)) end ## diff --git a/lib/blacklight/search_state.rb b/lib/blacklight/search_state.rb index cafc75f43a..f1c00c5867 100644 --- a/lib/blacklight/search_state.rb +++ b/lib/blacklight/search_state.rb @@ -17,7 +17,7 @@ def initialize(params, blacklight_config) # This is the typical (not-ActionView::TestCase) code path. @params = params.to_unsafe_h # In Rails 5 to_unsafe_h returns a HashWithIndifferentAccess, in Rails 4 it returns Hash - @params = params.with_indifferent_access if @params.instance_of? Hash + @params = @params.with_indifferent_access if @params.instance_of? Hash end @blacklight_config = blacklight_config end diff --git a/spec/support/controller_level_helpers.rb b/spec/support/controller_level_helpers.rb index 05a6b92cf0..973e510582 100644 --- a/spec/support/controller_level_helpers.rb +++ b/spec/support/controller_level_helpers.rb @@ -14,4 +14,4 @@ def blacklight_configuration_context def initialize_controller_helpers(helper) helper.extend ControllerViewHelpers end -end \ No newline at end of file +end