-
Notifications
You must be signed in to change notification settings - Fork 901
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
version_at not working as expected #354
Comments
I think it has the same cause as mentioned in #131 Report.version_at(date_2 + 1.second) returns the report with description "b", |
This is a dup of #314, closed in favor of that one. I have a branch pushed up, order_by_primary_key, which contains my preliminary implementation of my proposed fix. Give that a try if you'd like, should fix your issues. Please see #314 for more info. Sorry for the delayed response btw, my GitHub notifications were all messed up. |
Thanks, I tried this branch, but still have the same issues. But this has more to do with comparing of dates, rather than with the ordering of the keys. Why not simply store the timestamp "updated_at" of the old record in the version record, for example in a field called "model_updated_at", and use that timestamp for comparison when requesting "version_at"? In that case, there is no random time period between "updated_at" of the old record, and created_at of the version record. Rails timestamps should be left untouched, for there are |
Ok I understand and am aware of the issue you are speaking to. As you can see, I have a comment in the code noting the plan for handling this solution. The problem is as follows: the versions are currently constructed using a The plan to solve this is to switch the callback that handles building the Right now, I'm focusing on releasing |
The method "version_at" does not seem to work as expected.
Nice to know:
I use postgresql, with timestamps without timezone information,
so everything is stored in UTC (I checked this in the database).
My own timezone is Europe/Brussels. The only were timezone
is used, is when the dates are viewed in the interface.
Problem:
output (the date is shown in local time):
I logged the sql, and saw that paper_trail requests "versions.created" > 2014-04-04 08:12:43. This UTC is as expected: 2 hours lower than local time.
Any idea on how to solve this?
What am I doing wrong?
The text was updated successfully, but these errors were encountered: