Skip to content

Time vs String non-strict comparison #37

@marceloboeira

Description

@marceloboeira

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions