From 2ee28b2bf8414cad3655dbe685ff0d27051395cd Mon Sep 17 00:00:00 2001 From: Sergey Nartimov Date: Fri, 23 Mar 2012 23:08:36 +0300 Subject: fix HashWithIndifferentAccess.[] method --- activesupport/lib/active_support/hash_with_indifferent_access.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb index 49aa012268..91459f3e5b 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -42,6 +42,10 @@ module ActiveSupport end end + def self.[](*args) + new.merge(Hash[*args]) + end + alias_method :regular_writer, :[]= unless method_defined?(:regular_writer) alias_method :regular_update, :update unless method_defined?(:regular_update) -- cgit v1.2.3