mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #22821 from shosti/set-null-transaction
Allow add_to_transaction with null transaction
This commit is contained in:
commit
5ba6999637
2 changed files with 6 additions and 0 deletions
|
@ -33,6 +33,7 @@ module ActiveRecord
|
|||
|
||||
class NullTransaction #:nodoc:
|
||||
def initialize; end
|
||||
def state; end
|
||||
def closed?; true; end
|
||||
def open?; false; end
|
||||
def joinable?; false; end
|
||||
|
|
|
@ -58,6 +58,11 @@ class TransactionTest < ActiveRecord::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def test_add_to_null_transaction
|
||||
topic = Topic.new
|
||||
topic.add_to_transaction
|
||||
end
|
||||
|
||||
def test_successful_with_return
|
||||
committed = false
|
||||
|
||||
|
|
Loading…
Reference in a new issue