aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-31 19:38:04 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-31 19:38:04 +0000
commitfbf9281f0e3ced714bc534821c8b241ed7ec358e (patch)
tree890ca27b4ca235627f0be7b31ec7ce511f7c5968 /activerecord/CHANGELOG
parent60caf0e66172667400777674d09ade1032907076 (diff)
downloadrails-fbf9281f0e3ced714bc534821c8b241ed7ec358e.tar.gz
rails-fbf9281f0e3ced714bc534821c8b241ed7ec358e.tar.bz2
rails-fbf9281f0e3ced714bc534821c8b241ed7ec358e.zip
Added automated optimistic locking if the field lock_version is present #384 [Michael Koziarski]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@295 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/CHANGELOG')
-rw-r--r--activerecord/CHANGELOG18
1 files changed, 18 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index b97085cdba..8a0d75ee8a 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -1,5 +1,23 @@
*SVN*
+* Added automated optimistic locking if the field <tt>lock_version</tt> is present. Each update to the
+ record increments the lock_version column and the locking facilities ensure that records instantiated twice
+ will let the last one saved raise a StaleObjectError if the first was also updated. Example:
+
+ p1 = Person.find(1)
+ p2 = Person.find(1)
+
+ p1.first_name = "Michael"
+ p1.save
+
+ p2.first_name = "should fail"
+ p2.save # Raises a ActiveRecord::StaleObjectError
+
+ You're then responsible for dealing with the conflict by rescuing the exception and either rolling back, merging,
+ or otherwise apply the business logic needed to resolve the conflict.
+
+ #384 [Michael Koziarski]
+
* Added :counter_cache option to acts_as_tree that works just like the one you can define on belongs_to #371 [Josh]
* Fixed quoting in validates_format_of that would allow some rules to pass regardless of input #390 [Dmitry V. Sabanin]