Sha256: 7ae2a128e417f0c85d91838a38d6f4e9d0a9e3202f16b96512ed2f3d3812b3fe
Contents?: true
Size: 893 Bytes
Versions: 15
Compression:
Stored size: 893 Bytes
Contents
require 'hashie' module Traject module Hashie # Backporting fix from https://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 https://github.com/intridea/hashie/issues/451 module IndifferentAccessFix def merge(*args) result = super ::Hashie::Extensions::IndifferentAccess.inject!(result) if hash_lacking_indifference?(result) result.convert! end end end end Hashie::Extensions::IndifferentAccess.include(Traject::Hashie::IndifferentAccessFix)
Version data entries
15 entries across 15 versions & 1 rubygems