Permalink
Browse files

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>
  • Loading branch information...
1 parent 5f95347 commit 2dab082d0e1382eb0bc6a143bef6db8deebfd812 @fcheung fcheung committed with lifo Dec 10, 2008
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/transactions.rb
@@ -147,7 +147,7 @@ def save_with_transactions(perform_validation = true) #:nodoc:
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 @@ def rollback_active_record_state!
# 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

0 comments on commit 2dab082

Please sign in to comment.