From a24a888afe5652e391ce2ea682596686af5ec58b Mon Sep 17 00:00:00 2001 From: wycats Date: Sat, 27 Mar 2010 02:59:10 -0700 Subject: Limit Array#extract_options! to directl instances of Hash and HWIA. Add extractable_options? to Hash so that subclasses of Hash can opt-into extractable behavior. This fixes an issue where respond_with wasn't working with subclasses of Hash that were provided by other libraries (such as CouchDB or Mashie) [#4145 state:resolved] --- activesupport/lib/active_support/hash_with_indifferent_access.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activesupport/lib/active_support/hash_with_indifferent_access.rb') diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb index 543dab4a75..8241b69c8b 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -4,6 +4,10 @@ module ActiveSupport class HashWithIndifferentAccess < Hash + def extractable_options? + true + end + def initialize(constructor = {}) if constructor.is_a?(Hash) super() -- cgit v1.2.3