ActiveSupport OrderedHash Doesn't Support Passing Block to merge

Hi all,

On versions of Ruby prior to 1.9 (where Hashes' keys have no set
order), ActiveSupport::OrderedHash implements its own merge and merge!
methods. These implementations differ to the standard library however
in that they do not support passing a block to merge (c.f. for the standard
method signature).

I have posted a patch including tests at
to correct this missing functionality. The implementation also closely
matches that of Rubinius' (c.f.

Any feedback would be greatly appreciated.

Excellent, applied

Just realized the patch is not compatible with 1.9, since in 1.9 only
existing keys are merged (that's the key? key test in Rubinius). Will
revise it myself.

Rather, yield is called only for existing keys. This revisions seems
to be correct:

I've done a tiny improvement to this implementation.
Please Xavier review it ;).

Good, it is up