Skip to content

Conversation

@ollym
Copy link

@ollym ollym commented Dec 27, 2025

We use optimistic locking on tables that also do positioning, the way positioning was done (using update_all) breaks optimistic locking because it increments the lock_version meaning any already loaded models become stale.

So I've migrated to using a lower-level Arel::UpdateManager instead and made sure to also take care of timestamp columns (updated_at etc.) for those who also use caching.

Finally we no longer needed quoted_column which was a bit hacky to begin with, so I removed that method.

@ollym
Copy link
Author

ollym commented Dec 28, 2025

@brendon I added a fix for Rails 6.1 if you'd like to rerun tests, thanks

@ollym
Copy link
Author

ollym commented Dec 30, 2025

Same here, tests pass locally, unclear what's wrong with CI

$ DB=postgresql rake test
Run options: --seed 29421

# Running:

...............................................................................................................................................................................

Finished in 8.557468s, 20.4500 runs/s, 368.8007 assertions/s.

175 runs, 3156 assertions, 0 failures, 0 errors, 0 skips

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

Successfully merging this pull request may close these issues.

1 participant