From 071ddb82812d1336450c9cbc6b317d5edfff3731 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Mon, 7 Mar 2011 06:18:32 +0900 Subject: more "SSL everywhere" for GitHub URLs see: https://github.com/blog/738-sidejack-prevention-phase-2-ssl-everywhere --- activesupport/lib/active_support/core_ext/array/random_access.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/array/random_access.rb b/activesupport/lib/active_support/core_ext/array/random_access.rb index 9a6b5e9b79..ab1fa7cd5b 100644 --- a/activesupport/lib/active_support/core_ext/array/random_access.rb +++ b/activesupport/lib/active_support/core_ext/array/random_access.rb @@ -1,5 +1,5 @@ class Array - # Backport of Array#sample based on Marc-Andre Lafortune's http://github.com/marcandre/backports/ + # Backport of Array#sample based on Marc-Andre Lafortune's https://github.com/marcandre/backports/ # Returns a random element or +n+ random elements from the array. # If the array is empty and +n+ is nil, returns nil. if +n+ is passed, returns []. # @@ -24,4 +24,4 @@ class Array result[n..size] = [] result end unless method_defined? :sample -end \ No newline at end of file +end -- cgit v1.2.3 From 55d2a211d374b7e8102a72bcd1313ef4b097ba73 Mon Sep 17 00:00:00 2001 From: Dalibor Nasevic Date: Sun, 6 Mar 2011 23:54:18 +0100 Subject: Improved docs for Hash#to_param method --- activesupport/lib/active_support/core_ext/object/to_param.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'activesupport/lib/active_support/core_ext') 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 593f376159..5e0ad4d1cf 100644 --- a/activesupport/lib/active_support/core_ext/object/to_param.rb +++ b/activesupport/lib/active_support/core_ext/object/to_param.rb @@ -34,12 +34,11 @@ end class Hash # Converts a hash into a string suitable for use as a URL query string. An optional namespace can be # passed to enclose the param names (see example below). The string pairs "key=value" that conform the query - # string are sorted lexicographically in ascending order. + # string are sorted lexicographically in ascending order. This method is also aliased as to_query. # # ==== Examples # { :name => 'David', :nationality => 'Danish' }.to_param # => "name=David&nationality=Danish" - # - # { :name => 'David', :nationality => 'Danish' }.to_query('user') # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" + # { :name => 'David', :nationality => 'Danish' }.to_param('user') # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" def to_param(namespace = nil) collect do |key, value| value.to_query(namespace ? "#{namespace}[#{key}]" : key) -- cgit v1.2.3