Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Optimistic Locking (revised)

#59 Optimistic Locking (revised)

Aug 04, 2012 | 8 minutes | Active Record
There is a chance one user will unintentionally override someone else's changes if they update a record near the same time. One solution is to use optimistic locking. The updated_at column can also be used for this as shown.