aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/CHANGELOG
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-09 00:11:12 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-09 00:11:12 +0000
commit0a84624bd78643f2161d162f68669de03fe2bac8 (patch)
tree5f4f21f814a6be2db296fbad2fe7658d62f7c4f3 /activeresource/CHANGELOG
parent2c6747f858481efa1bc3612e955861c13dc1c95b (diff)
downloadrails-0a84624bd78643f2161d162f68669de03fe2bac8.tar.gz
rails-0a84624bd78643f2161d162f68669de03fe2bac8.tar.bz2
rails-0a84624bd78643f2161d162f68669de03fe2bac8.zip
Optimistic locking: raise ActiveResource::ResourceConflict on 409 Conflict response.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5078 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activeresource/CHANGELOG')
-rw-r--r--activeresource/CHANGELOG9
1 files changed, 9 insertions, 0 deletions
diff --git a/activeresource/CHANGELOG b/activeresource/CHANGELOG
index ef3f3f6a17..c81f7daacb 100644
--- a/activeresource/CHANGELOG
+++ b/activeresource/CHANGELOG
@@ -1,5 +1,14 @@
*SVN*
+* Optimistic locking: raise ActiveResource::ResourceConflict on 409 Conflict response. [Jeremy Kemper]
+
+ # Example controller action
+ def update
+ @person.save!
+ rescue ActiveRecord::StaleObjectError
+ render :xml => @person.reload.to_xml, :status => '409 Conflict'
+ end
+
* Basic validation support [Rick Olson]
Parses the xml response of ActiveRecord::Errors#to_xml with a similar interface to ActiveRecord::Errors.