Before a record is saved, mm-optimistic_locking will check if it has been modified by another process. If so, a StaleDocumentError will be raised. The object can be reloaded and resaved after the conflict has been resolved.
Andy Lindeman
gem "mm-optimistic_locking", "~> 0.0.3"