-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 1.3.1
-
Component/s: None
-
Environment:ruby 1.8.7 on linux
-
Fully Compatible
BSON::OrderedHash can be corrupted
steps to reproduce:
execute the following lines:
a = BSON::OrderedHash.new
a[:b] = :c
a.replace(:c => :d)
results
a is corrupted. For instance it inspects as:
{"b"=>nil}instead of:
{:c => :d}
the method 'replace' on Hash is not overridden !!!!!!!
implementation suggestion:
def replace(other_hash)
@ordered_keys.replace(other_hash.keys)
super
end