public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
slice now returns indifferent hash if called on one

Signed-off-by: Michael Koziarski <michael@koziarski.com>

[#1096 state:committed]
adam (author)
Tue Sep 23 03:08:24 -0700 2008
NZKoz (committer)
Tue Sep 23 05:04:20 -0700 2008
commit  2e75bd0808f4dcac328b690aaad176cbfe96773e
tree    2ecf4896fe8ea72f89b4b7286a9746028b7f9dea
parent  c452e49e763e3b7018f2cb550d318b2851703985
...
18
19
20
21
 
22
23
24
...
18
19
20
 
21
22
23
24
0
@@ -18,7 +18,7 @@ module ActiveSupport #:nodoc:
0
         # Returns a new hash with only the given keys.
0
         def slice(*keys)
0
           keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key)
0
-          hash = {}
0
+          hash = self.class.new
0
           keys.each { |k| hash[k] = self[k] if has_key?(k) }
0
           hash
0
         end

Comments