From 25bb98e42daa98c4207ea19bb80525d2b7cf8962 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 21 Feb 2007 22:13:39 +0000 Subject: Added database connection as a yield parameter to ActiveRecord::Base.transaction so you can manually rollback [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6196 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/CHANGELOG | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/CHANGELOG') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index ed1b83cdca..dade34a38b 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,13 @@ *SVN* +* Added database connection as a yield parameter to ActiveRecord::Base.transaction so you can manually rollback [DHH]. Example: + + transaction do |transaction| + david.withdrawal(100) + mary.deposit(100) + transaction.rollback! # rolls back the transaction that was otherwise going to be successful + end + * Made increment_counter/decrement_counter play nicely with optimistic locking, and added a more general update_counters method [Jamis Buck] * Reworked David's query cache to be available as Model.cache {...}. For the duration of the block no select query should be run more then once. Any inserts/deletes/executes will flush the whole cache however [Tobias Luetke] -- cgit v1.2.3