diff options
author | Arthur Nogueira Neves <github@arthurnn.com> | 2016-01-04 13:37:49 -0500 |
---|---|---|
committer | Arthur Nogueira Neves <github@arthurnn.com> | 2016-01-04 13:37:49 -0500 |
commit | 5ba6999637361577539eafc63a39622ff21e345b (patch) | |
tree | ab659597d0d55e5170bed295f09dca5e9e18f5a0 /activerecord | |
parent | 4158974c60d817c9bc1e2aecb342161295f2ac0d (diff) | |
parent | 95254e4f129cedd4048c63e2f068227d5f80864d (diff) | |
download | rails-5ba6999637361577539eafc63a39622ff21e345b.tar.gz rails-5ba6999637361577539eafc63a39622ff21e345b.tar.bz2 rails-5ba6999637361577539eafc63a39622ff21e345b.zip |
Merge pull request #22821 from shosti/set-null-transaction
Allow add_to_transaction with null transaction
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/transaction.rb | 1 | ||||
-rw-r--r-- | activerecord/test/cases/transactions_test.rb | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb b/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb index 295a7bed87..14d04a6388 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb @@ -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 diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb index ec5bdfd725..791b895d02 100644 --- a/activerecord/test/cases/transactions_test.rb +++ b/activerecord/test/cases/transactions_test.rb @@ -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 |