Hi,
it''s been some time since your post, but I''ll respond to it
anyway
because
maybe you''re still looking for a solution.
I''d suggest you to use Riff. It will let you compare two AR objects
with each other. Before you apply the form data to your object,
you could clone it to a @dbrecord-var and afterward compare
both objects with Riff. You can find more on riff here:
http://wiki.rubyonrails.org/rails/pages/Riff+Plugin
Greetings,
Christoph
On 18 Apr., 22:56, Michael
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Hello,
>
> I need to use the magic column "lock_version" to prevent users
from
> updating a record simultaneously. I''ve got it working without a
> problem.
>
> 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 theStaleObjectErrorexception 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.
>
> Any pointers?
>
> Thanks,
>
> Michael
>
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---