hashdiff icon indicating copy to clipboard operation
hashdiff copied to clipboard

Time vs String non-strict comparison

Open marceloboeira opened this issue 7 years ago • 1 comments

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.

marceloboeira avatar Aug 28 '17 13:08 marceloboeira

Is this still an issue?

krzysiek1507 avatar Apr 24 '19 16:04 krzysiek1507