diff options
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/hash_with_indifferent_access.rb | 4 | ||||
-rw-r--r-- | activesupport/lib/active_support/rescuable.rb | 2 |
2 files changed, 5 insertions, 1 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) diff --git a/activesupport/lib/active_support/rescuable.rb b/activesupport/lib/active_support/rescuable.rb index 0fbe6e5b29..85e84bc203 100644 --- a/activesupport/lib/active_support/rescuable.rb +++ b/activesupport/lib/active_support/rescuable.rb @@ -111,7 +111,7 @@ module ActiveSupport if rescuer.arity == 0 Proc.new { instance_exec(&rescuer) } else - Proc.new { |exception| instance_exec(exception, &rescuer) } + Proc.new { |_exception| instance_exec(_exception, &rescuer) } end end end |