After looking at code again, I think it can be simplified even
further, removing a nested if:

```ruby
  def deep_merge!(other_hash, &block)
    other_hash.each_pair do |key, new_value|
      original_value = self[key]

      self[key] = if original_value.is_a?(Hash) && new_value.is_a?(Hash)
        original_value.deep_merge(new_value, &block)
      elsif block && original_value
        block.call(key, original_value, new_value)
      else
        new_value
      end
    end

    self
  end
```

Please double check to ensure logic is the same, but I think it is.

On Mon, May 6, 2013 at 10:51 PM, aditya-kapoor <notifications@github.com> wrote:
> In activesupport/lib/active_support/core_ext/hash/deep_merge.rb:
>
>>        else
>> -        self[k] = block && tv ? block.call(k, tv, v) : v
>> +        self[key] = block && self_initial_value ? block.call(key,
>> self_initial_value, new_value) : new_value
>
> yes you can...incorporating these changes
>
> —
> Reply to this email directly or view it on GitHub.