mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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>
This commit is contained in:
committed by
Jeremy Kemper
parent
9f69ff12d4
commit
455c7f9e37
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user