Skip to content
Browse files

Cookie above geoip priority

  • Loading branch information...
1 parent c4e6a92 commit b53055135da4ab350f2b0cf06263d1961664ab9d @pyromaniac pyromaniac committed May 10, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/controllers/nano_api/searches_controller.rb
View
4 app/controllers/nano_api/searches_controller.rb
@@ -31,14 +31,14 @@ def create
def search_params
search_params = params[:search].is_a?(Hash) ? params[:search] : params
+ cookie_defaults = JSON.parse(cookies[:ls].presence || '{}')
+ search_params.reverse_merge!(cookie_defaults) if cookie_defaults.is_a?(Hash)
geoip_defaults = begin
{:origin_name => user_location[:name], :origin_iata => user_location[:iata]} if user_location.is_a?(Hash)
rescue
{}
end
search_params.reverse_merge!(geoip_defaults)
- cookie_defaults = JSON.parse(cookies[:ls].presence || '{}')
- search_params.reverse_merge!(cookie_defaults) if cookie_defaults.is_a?(Hash)
end
end

0 comments on commit b530551

Please sign in to comment.
Something went wrong with that request. Please try again.