hashdiff
hashdiff copied to clipboard
Time vs String non-strict comparison
I have 2 hashes, both with a "created_at" attribute, they are the same, however, that's the behavior I get from the gem when I try to compare both:
[1] > new[:created_at]
=> "2017-08-28T12:12:22.760Z"
[2] > current[:created_at]
=> "2017-08-28T12:12:22.760Z"
[3] > current[:created_at] == new[:created_at]
=> true
[4] > HashDiff.diff(new, current)
=> [["~", "created_at", "2017-08-28T12:12:22.760Z", "2017-08-28T12:12:22.760Z"]]
Update - 29/08
The timestamps are serialized the same way, but one is a string and the other is a time.
Eitherway, if the comparinson is not strict we should declare as equal.
Is this still an issue?