module Traject::Hashie::IndifferentAccessFix

Backporting fix from github.com/intridea/hashie/commit/a82c594710e1bc9460d3de4d2989cb700f4c3c7f into Hashie.

This makes merge(ordinary_hash) on a Hash that has IndifferentAccess included work, without raising. Which we needed.

As of this writing that fix is not available in a Hashie release, if it becomes so later than this monkey-patch may no longer be required, we can just depend on fixed version.

See also github.com/intridea/hashie/issues/451

Public Instance Methods

merge(*args) click to toggle source
Calls superclass method
# File lib/traject/hashie/indifferent_access_fix.rb, line 16
def merge(*args)
  result = super
  ::Hashie::Extensions::IndifferentAccess.inject!(result) if hash_lacking_indifference?(result)
  result.convert!
end