diff options
author | Sergey Nartimov <just.lest@gmail.com> | 2012-03-23 23:08:36 +0300 |
---|---|---|
committer | Sergey Nartimov <just.lest@gmail.com> | 2012-03-23 23:09:29 +0300 |
commit | 2ee28b2bf8414cad3655dbe685ff0d27051395cd (patch) | |
tree | 42406d06accb8448bd8696918fe39c75f885e950 /activesupport/lib | |
parent | ea482d366addd86ea3a5255e6e764733b9a17fa8 (diff) | |
download | rails-2ee28b2bf8414cad3655dbe685ff0d27051395cd.tar.gz rails-2ee28b2bf8414cad3655dbe685ff0d27051395cd.tar.bz2 rails-2ee28b2bf8414cad3655dbe685ff0d27051395cd.zip |
fix HashWithIndifferentAccess.[] method
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/hash_with_indifferent_access.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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) |