Add optimistic lock to avoid race conditions when handling votes (#10196)
* Add optimistic lock to avoid race conditions when handling votes * Force-reload polls when getting `ActiveRecord::StaleObjectError`master
parent
b3668a79ec
commit
96f905f409
@ -0,0 +1,6 @@ |
|||||||
|
class AddLockVersionToPolls < ActiveRecord::Migration[5.2] |
||||||
|
def change |
||||||
|
add_column :polls, :lock_version, :integer, null: false, default: 0 |
||||||
|
end |
||||||
|
end |
||||||
|
|
Loading…
Reference in new issue