Project
delta_attributes
This gem makes updating specified number fields by ActiveRecord in unusual way.
Instead of generating sql script to update value in usual way like this:
UPDATE users
SET money = 10
WHERE id = 1;
It replaces it with
UPDATE users
SET money = money + delta
WHERE id = 1;
where delta is difference between old value and new value of that field.
This solves problem with simultaneous updating of the same field by different threads
(problem known as race condition).
Source code: https://github.com/izbor/delta_attributes
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
Development
Licenses
MIT
Dependencies
Runtime
>= 3.2