I have a rails app where a particular form submit for a model is a two step process: on the first submit, the rails controller issues a render of a modal confirmation form, from which either the update action is invoked or the whole thing cancelled.
Rails optimistic locking seems like the answer here for dealing with out of date updates.
But for the user experience, if the Rails controller can compare the user A's model version against the current version without waiting until the update action to determine if the model is already out of date (due to user B updating the model in question concurrently), then another sort of view could be rendered indicating to user A that he needs to examine the updated model.
Are there any issues or gotchas associated with manually checking the :lock_version field in the controller and comparing it to the params[] version? Is there some built-in or "formal" way of doing this or should the controller just do the check explicitly?