aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/transactions.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-12-22 11:26:03 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-12-22 11:26:03 +0000
commit8b5f4e474f30560da85f52dd64dc3b45d0338b93 (patch)
tree0ba6fdc63093d9cc5549498d9f62238bea80a4cf /activerecord/lib/active_record/transactions.rb
parentdc901ced448179d9dfec924e22d8444b1a75265c (diff)
downloadrails-8b5f4e474f30560da85f52dd64dc3b45d0338b93.tar.gz
rails-8b5f4e474f30560da85f52dd64dc3b45d0338b93.tar.bz2
rails-8b5f4e474f30560da85f52dd64dc3b45d0338b93.zip
Ruby 1.9 compat: fix warnings, shadowed block vars, and unitialized instance vars
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8481 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/transactions.rb')
-rw-r--r--activerecord/lib/active_record/transactions.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb
index 45a6418492..9c68435b0c 100644
--- a/activerecord/lib/active_record/transactions.rb
+++ b/activerecord/lib/active_record/transactions.rb
@@ -15,7 +15,7 @@ module ActiveRecord
end
end
- # Transactions are protective blocks where SQL statements are only permanent if they can all succeed as one atomic action.
+ # Transactions are protective blocks where SQL statements are only permanent if they can all succeed as one atomic action.
# The classic example is a transfer between two accounts where you can only have a deposit if the withdrawal succeeded and
# vice versa. Transactions enforce the integrity of the database and guard the data against program errors or database break-downs.
# So basically you should use transaction blocks whenever you have a number of statements that must be executed together or
@@ -116,7 +116,7 @@ module ActiveRecord
def rollback_active_record_state!
id_present = has_attribute?(self.class.primary_key)
previous_id = id
- previous_new_record = @new_record
+ previous_new_record = new_record?
yield
rescue Exception
@new_record = previous_new_record
@@ -125,7 +125,7 @@ module ActiveRecord
else
@attributes.delete(self.class.primary_key)
@attributes_cache.delete(self.class.primary_key)
- end
+ end
raise
end
end