提交 455c7f9e 编写于 作者: F Frederick Cheung 提交者: Jeremy Kemper

Don't use the transaction instance method so that people with...

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: NJeremy Kemper <jeremy@bitsweat.net>
上级 9f69ff12
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册