activerecord/test/cases/defaults_test.rb
# ActiveRecord::Base#create! (and #save and other related methods) will
# open a new transaction. When in transactional tests mode, this will
# cause Active Record to create a new savepoint. However, since MySQL doesn't
# support DDL transactions, creating a table will result in any created
# savepoints to be automatically released. This in turn causes the savepoint
# release code in AbstractAdapter#transaction to fail.
#
# We don't want that to happen, so we disable transactional tests here.
:Base#create. (and #save and other related methods) will
open a new transaction. When in transactional tests mode, this will
cause Active Record to create a new savepoint. However, since MySQL doesn't
support DDL transactions, creating a table will result in any created
savepoints to be automatically released. This in turn causes the savepoint
release code in AbstractAdapter#transaction to fail.

We don't want that to happen, so we disable transactional tests here.
: Base#create . ( and #save and other related methods ) will open a new transaction . When in transactional tests mode this will cause Active Record to create a new savepoint . However since MySQL doesn ' t support DDL transactions creating a table will result in any created savepoints to be automatically released . This in turn causes the savepoint release code in AbstractAdapter#transaction to fail . We don ' t want that to happen so we disable transactional tests here .
def using_strict(strict)
      connection = ActiveRecord::Base.remove_connection
      conn_hash = connection.configuration_hash
      ActiveRecord::Base.establish_connection conn_hash.merge(strict: strict)
      yield
    ensure
      ActiveRecord::Base.remove_connection
      ActiveRecord::Base.establish_connection connection
    end
def using_strict ( strict ) connection = ActiveRecord :: Base . remove_connection conn_hash = connection . configuration_hash ActiveRecord :: Base . establish_connection conn_hash . merge ( strict : strict ) yield ensure ActiveRecord :: Base . remove_connection ActiveRecord :: Base . establish_connection connection end
ActiveRecord::Base#create!
ActiveRecord :: Base#create!
strict
<not_specific>