In Rails 2.2.2, if I retrieve a record using a Model.find method (any
of the finds), make changes to it, and then save it, is there a
possibility that another user (on a different thread, maybe a faster
machine) could read the same record after me, but update it before
me? If so, then the other user’s changes would be lost (a data
How does Rails prevent this?
Is there a way to do something like
Is there a find_and_lock, find_for_update, or other similar function?
This is different than dirty records, because it is comparing the
record I have in my session to the same record in the database to
ensure that no one else changed it.