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

updated_at timestamp gets current timestamp on model find/hydrate when record field is empty #268

Closed
circulon opened this issue Dec 17, 2020 · 7 comments · Fixed by #269
Closed
Labels
bug An existing feature is not working as intended

Comments

@circulon
Copy link
Contributor

when using the default for the timestamps attribute the updated_at attribute gets populated with the current timestamp if it is empty/null when selecting amodel record that has never been updated
thus providing a false positive of its actual "updated_at" status

The desired behaviour is to reflect the record field value ie None when populating a model object and the record field is empty

Currently having to disable auto handling of timestamps as queries based on updated_at sorting are not accurate.

@josephmancuso
Copy link
Member

@circulon can you give me some code examples of how to replicate this?

@josephmancuso
Copy link
Member

when trying to replicate this it looks like I came across and issue where the updated_at was not even getting set when updating a record

@josephmancuso
Copy link
Member

I think what you are saying that if record ID 1 has updated_at as NULL and you fetch the record it will actually hydrate as the current time stamp.

Can you try again on latest version of the ORM? I think this may have been fixed already

@circulon
Copy link
Contributor Author

Yes thats exactly what I mean.

I'm at work and will add and will test once im home and report back.

@circulon
Copy link
Contributor Author

@josephmancuso

Confirmed this issue is fixed in the current 0.9.1 release
Thanks for checking

@josephmancuso
Copy link
Member

Ok cool. Yeah this was fixed in 0.9.0

Fixed issue where dates were defaulting to today's date

@josephmancuso
Copy link
Member

Thanks for pointing this out

@josephmancuso josephmancuso added the bug An existing feature is not working as intended label Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An existing feature is not working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants