Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time vs String non-strict comparison #37

Open
marceloboeira opened this issue Aug 28, 2017 · 1 comment
Open

Time vs String non-strict comparison #37

marceloboeira opened this issue Aug 28, 2017 · 1 comment

Comments

@marceloboeira
Copy link

marceloboeira commented Aug 28, 2017

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 marceloboeira changed the title Weird comparison behaviour Time vs String non-string comparison Aug 29, 2017
@marceloboeira marceloboeira changed the title Time vs String non-string comparison Time vs String non-strict comparison Aug 29, 2017
@krzysiek1507
Copy link
Collaborator

Is this still an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants