Repository navigation
Conversation
Now, AR#increment! is concurrent safe(rails#11410). However, this commit breaks backward compatability because `.update_counters` doesn't update timestamp. Here is a reproduction script for this issue. https://gist.github.com/akihiro17/aa08276f5d0f72d9869b In this commit, `.update_counters` updates timestamp if both `touch` and `record_time_stamp` are true.
|
r? @kaspth (@rails-bot has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
are these intended to be user-overridable?
if yes, should you use these methods rather than constants in https://github.com/rails/rails/pull/21979/files#diff-ec4e6359a60e5d11bbc4bd0912265c27R87 ? if not, why not just remove the methods and use the constants directly?
|
r? @jeremy It is very strange that Good catch with touch. But it is still questionable: perform touch but do not perform a validation. I am also not sure touch should be permanent. In my use cases I would prefer no touch. Not sure we can change the behavior. @jeremy what do you think? |
|
Timestamp touching has been added to It's on track for 5.1. Thanks! 😉 |
|
It's still not possible to touch the record when calling With the changes from #26995, the implementation should be pretty straightforward - |
|
PR welcome 🤘 |
|
I'll give @akihiro17 a chance to pick this back up if they want to first. |
|
I created #27660. Thanks. |
Now, AR#increment! is concurrent safe(#11410). However, this commit breaks backward compatability because
.update_countersdoesn't update timestamp.Here is a reproduction script for this issue.
https://gist.github.com/akihiro17/aa08276f5d0f72d9869b
In this commit,
.update_countersupdates timestamp if bothtouchandrecord_time_stampare true.