I need to use the magic column “lock_version” to prevent users from
updating a record simultaneously. I’ve got it working without a
Has anyone implemented a nice way to handle the conflict resolution. I
don’t want to just tell the user - Sorry, already been updated, try
again. Instead, I would like to present a list of fields that are
conflicted and allow that user who got the error to determine how they
want to handle the conflict and then save the record.
It seems the way to do something like this would be to query the record
by id when the StaleObjectError exception is caught. Then, compare the
params submitted with the freshly queried record and come up with a list
of values that are different. Take this list, send it back to the user
and let them decide what to do.
Instead of writing this from scratch my guess is someone on this list
has already done something similar.