diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-07-16 17:27:03 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-07-16 17:27:03 -0700 |
commit | f875331e3282228d2019392b1653fb8ea39fd711 (patch) | |
tree | a3e9630edde5276ccffdad5fee26e033644040a8 /actionpack/lib/action_dispatch | |
parent | 1e930e7a488c91beaebfa9682394877e9ad70183 (diff) | |
download | rails-f875331e3282228d2019392b1653fb8ea39fd711.tar.gz rails-f875331e3282228d2019392b1653fb8ea39fd711.tar.bz2 rails-f875331e3282228d2019392b1653fb8ea39fd711.zip |
only extract :params from the options hash once
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/url.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb index 6ba2820d09..f5e71f5a3d 100644 --- a/actionpack/lib/action_dispatch/http/url.rb +++ b/actionpack/lib/action_dispatch/http/url.rb @@ -48,9 +48,8 @@ module ActionDispatch end if options.key? :params - params = options[:params].is_a?(Hash) ? - options[:params] : - { params: options[:params] } + param = options[:params] + params = param.is_a?(Hash) ? param : { params: param } params.reject! { |_,v| v.to_param.nil? } result << "?#{params.to_query}" unless params.empty? |