Skip to content

Commit

Permalink
Don't use the transaction instance method so that people with has_one…
Browse files Browse the repository at this point in the history
…/belongs_to :transaction aren't fubared

[rails#1551 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
fcheung authored and lifo committed Apr 1, 2009
1 parent 5f95347 commit 2dab082
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/transactions.rb
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2dab082

Please sign in to comment.