Skip to content

Commit

Permalink
Operate on the instance variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Jan 4, 2016
1 parent 87dd1fd commit e120c98
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/helpers/blacklight/url_helper_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

##
Expand Down
2 changes: 1 addition & 1 deletion lib/blacklight/search_state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/support/controller_level_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ def blacklight_configuration_context
def initialize_controller_helpers(helper)
helper.extend ControllerViewHelpers
end
end
end

0 comments on commit e120c98

Please sign in to comment.