On 22 Jun 2008, at 12:12, Greg Willits wrote:
>
> I have a need to update a record but without changing the
> lock_version -- or to at least .save without triggering a stale error
> if the lock_version has changed.
>
> Is either possible? I''ve tried the API and some blogs, so far no
> hints...
>
def without_locking
old_value, ActiveRecord::Base.lock_optimistically =
ActiveRecord::Base.lock_optimistically, false
yield
ensure
ActiveRecord::Base.lock_optimistically = old_value
end
You could whack that into activerecord if you used it often enough.
That said, if I wanted to ignore optimisic locking then I probably
wouldn''t be using it in the first place.
Fred
> -- gw
>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---