lib/generators/dry_crud/templates/test/crud_test_model.rb
# hack to avoid ddl in transaction issues with mysql.
hack to avoid ddl in transaction issues with mysql.
hack to avoid ddl in transaction issues with mysql .
def without_transaction
    c = ActiveRecord::Base.connection
    start_transaction = false
    if c.adapter_name.downcase.include?('mysql') && c.open_transactions > 0
      c.execute("ROLLBACK")
      start_transaction = true
    end
    yield
    c.execute("BEGIN") if start_transaction
  end
def without_transaction c = ActiveRecord :: Base . connection start_transaction = false if c . adapter_name . downcase . include? ( 'mysql' ) && c . open_transactions > 0 c . execute ( "ROLLBACK" ) start_transaction = true end yield c . execute ( "BEGIN" ) if start_transaction end
hack to avoid ddl in transaction issues with mysql.
hack to avoid ddl in transaction issues with mysql .
# in transactional tests, we may simply rollback