In Rails 2.x, calling touch on an ActiveRecord model would update the
''lock_version'' on the model, if it were present.
It would produce something like this in SQL:
UPDATE `foo` SET `updated_at` = ''2010-07-23 10:44:19'',
`lock_version''
= 2 WHERE ''lock_version'' = 1
This would ensure that your optimistic locking policy will be followed
should another concurrent update occur on that row in your database.
Rails 3 no longer updates the ''lock_version'' column through
the touch
method. I preferred the Rails 2 behaviour, I was wondering if anyone
knew the reasoning behind this change?
Regards,
C.
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.