diff options
author | pavel <pavel.rosicky@easy.cz> | 2018-07-15 05:11:16 +0200 |
---|---|---|
committer | pavel <pavel.rosicky@easy.cz> | 2018-07-15 06:09:43 +0200 |
commit | 425449e98d0539e3fa4debb819283103cf27bce5 (patch) | |
tree | 12db31c9a6df50a27e5ceccd45ab66729f792219 /activerecord/test | |
parent | 05bef140519fe3410fd8d352f5ea84fd1a278063 (diff) | |
download | rails-425449e98d0539e3fa4debb819283103cf27bce5.tar.gz rails-425449e98d0539e3fa4debb819283103cf27bce5.tar.bz2 rails-425449e98d0539e3fa4debb819283103cf27bce5.zip |
use set_server_option if possible
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/fixtures_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index 2ead2c4816..639627852d 100644 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -114,6 +114,21 @@ class FixturesTest < ActiveRecord::TestCase end end end + + def test_bulk_insert_with_a_multi_statement_query_in_a_nested_transaction + fixtures = { + "traffic_lights" => [ + { "location" => "US", "state" => ["NY"], "long_state" => ["a"] }, + ] + } + + ActiveRecord::Base.transaction do + con = ActiveRecord::Base.connection + assert_equal 1, con.open_transactions + con.insert_fixtures_set(fixtures) + assert_equal 1, con.open_transactions + end + end end if current_adapter?(:Mysql2Adapter) |