diff options
author | Hincu Petru <hincupetru@gmail.com> | 2014-02-03 09:51:05 +0000 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-02-05 23:31:50 -0200 |
commit | 326e6527497126b2ea3627e377b6a4b5c9191bef (patch) | |
tree | 8d13260b7ad28b511a6f5b0ec02c945497033416 /activesupport/lib | |
parent | 6cc3afb00a0d7689f5435a3845fd17266d935c3e (diff) | |
download | rails-326e6527497126b2ea3627e377b6a4b5c9191bef.tar.gz rails-326e6527497126b2ea3627e377b6a4b5c9191bef.tar.bz2 rails-326e6527497126b2ea3627e377b6a4b5c9191bef.zip |
Fixed "Hash#to_param confused by empty hash values #13892"
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/to_param.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/to_param.rb b/activesupport/lib/active_support/core_ext/object/to_param.rb index 3b137ce6ae..e40846e7d6 100644 --- a/activesupport/lib/active_support/core_ext/object/to_param.rb +++ b/activesupport/lib/active_support/core_ext/object/to_param.rb @@ -51,6 +51,7 @@ class Hash # # This method is also aliased as +to_query+. def to_param(namespace = nil) + return (namespace ? nil.to_query(namespace) : '') if empty? collect do |key, value| value.to_query(namespace ? "#{namespace}[#{key}]" : key) end.sort! * '&' |