1
0
Fork 0
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:
Arthur Nogueira Neves 2016-01-04 13:37:49 -05:00
commit 5ba6999637
2 changed files with 6 additions and 0 deletions

View file

@ -33,6 +33,7 @@ module ActiveRecord
class NullTransaction #:nodoc: class NullTransaction #:nodoc:
def initialize; end def initialize; end
def state; end
def closed?; true; end def closed?; true; end
def open?; false; end def open?; false; end
def joinable?; false; end def joinable?; false; end

View file

@ -58,6 +58,11 @@ class TransactionTest < ActiveRecord::TestCase
end end
end end
def test_add_to_null_transaction
topic = Topic.new
topic.add_to_transaction
end
def test_successful_with_return def test_successful_with_return
committed = false committed = false