Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

search private and protected methods for convert_key

  • Loading branch information...
commit 7cc26fd15e27c4a13705a844538bebfdd0461729 1 parent 45e9cac
@tenderlove tenderlove authored sikachu committed
View
1  activesupport/lib/active_support/core_ext/hash/indifferent_access.rb
@@ -1,7 +1,6 @@
require 'active_support/hash_with_indifferent_access'
class Hash
-
# Returns an <tt>ActiveSupport::HashWithIndifferentAccess</tt> out of its receiver:
#
# {:a => 1}.with_indifferent_access["a"] # => 1
View
4 activesupport/lib/active_support/core_ext/hash/slice.rb
@@ -13,7 +13,7 @@ class Hash
# valid_keys = [:mass, :velocity, :time]
# search(options.slice(*valid_keys))
def slice(*keys)
- keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key)
+ keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key, true)

(from @raggi) this is a bug, as activesupport::orderedoptions does not support this

Was not this fixed yet on Rails 3.2.x ? I am referring to the bug on OrderedOptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
hash = self.class.new
keys.each { |k| hash[k] = self[k] if has_key?(k) }
hash
@@ -23,7 +23,7 @@ def slice(*keys)
# Returns a hash contained the removed key/value pairs
# {:a => 1, :b => 2, :c => 3, :d => 4}.slice!(:a, :b) # => {:c => 3, :d => 4}
def slice!(*keys)
- keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key)
+ keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key, true)
omit = slice(*self.keys - keys)
hash = slice(*keys)
replace(hash)
View
2  activesupport/lib/active_support/hash_with_indifferent_access.rb
@@ -6,7 +6,7 @@
module ActiveSupport
class HashWithIndifferentAccess < Hash
-
+
# Always returns true, so that <tt>Array#extract_options!</tt> finds members of this class.
def extractable_options?
true
Please sign in to comment.
Something went wrong with that request. Please try again.