diff options
author | Frederick Cheung <frederick.cheung@gmail.com> | 2008-12-10 20:57:19 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-12-10 15:11:42 -0800 |
commit | 455c7f9e37fda2969e52698b766413fc735eb488 (patch) | |
tree | 562397d6eef222326c3697b543af9909debd6ac9 | |
parent | 9f69ff12d44c4d1e475fd6efede120ccedba3b3e (diff) | |
download | rails-455c7f9e37fda2969e52698b766413fc735eb488.tar.gz rails-455c7f9e37fda2969e52698b766413fc735eb488.tar.bz2 rails-455c7f9e37fda2969e52698b766413fc735eb488.zip |
Don't use the transaction instance method so that people with has_one/belongs_to :transaction aren't fubared
[#1551 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
-rw-r--r-- | activerecord/lib/active_record/transactions.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb index 27b5aca18f..0a27ea980e 100644 --- a/activerecord/lib/active_record/transactions.rb +++ b/activerecord/lib/active_record/transactions.rb @@ -147,7 +147,7 @@ module ActiveRecord end def save_with_transactions! #:nodoc: - rollback_active_record_state! { transaction { save_without_transactions! } } + rollback_active_record_state! { self.class.transaction { save_without_transactions! } } end # Reset id and @new_record if the transaction rolls back. @@ -175,7 +175,7 @@ module ActiveRecord # instance. def with_transaction_returning_status(method, *args) status = nil - transaction do + self.class.transaction do status = send(method, *args) raise ActiveRecord::Rollback unless status end |