aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/conversions.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb
index d3ab3b3590..1cdf7d5c54 100644
--- a/activesupport/lib/active_support/core_ext/hash/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb
@@ -9,13 +9,13 @@ class Object
end
def to_query(key) #:nodoc:
- "#{CGI.escape(key.to_s)}=#{CGI.escape(to_param || "")}"
+ "#{CGI.escape(key.to_s)}=#{CGI.escape(to_param.to_s)}"
end
end
class Array
def to_query(key) #:nodoc:
- collect { |value| value.to_query("#{key}[]") } * '&'
+ collect { |value| value.to_query("#{key}[]") }.sort * '&'
end
end
@@ -48,7 +48,7 @@ module ActiveSupport #:nodoc:
def to_query(namespace = nil)
collect do |key, value|
value.to_query(namespace ? "#{namespace}[#{key}]" : key)
- end * '&'
+ end.sort * '&'
end
def to_xml(options = {})