mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Fixed Rails 3.2 superclass mismatch error
This commit is contained in:
parent
d6884704c0
commit
3ccc9a8767
1 changed files with 10 additions and 2 deletions
|
@ -29,7 +29,15 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
MYSQL_ADAPTER_PARENT = USE_ARJDBC_WORKAROUND ? JdbcAdapter : AbstractAdapter
|
# ActiveRecord 3.1 support
|
||||||
|
if defined?(AbstractMysqlAdapter)
|
||||||
|
MYSQL_ADAPTER_PARENT = USE_ARJDBC_WORKAROUND ? JdbcAdapter : AbstractMysqlAdapter
|
||||||
|
MYSQL2_ADAPTER_PARENT = AbstractMysqlAdapter
|
||||||
|
else
|
||||||
|
MYSQL_ADAPTER_PARENT = USE_ARJDBC_WORKAROUND ? JdbcAdapter : AbstractAdapter
|
||||||
|
MYSQL2_ADAPTER_PARENT = AbstractAdapter
|
||||||
|
end
|
||||||
|
|
||||||
SQLITE_ADAPTER_PARENT = USE_ARJDBC_WORKAROUND ? JdbcAdapter : SQLiteAdapter
|
SQLITE_ADAPTER_PARENT = USE_ARJDBC_WORKAROUND ? JdbcAdapter : SQLiteAdapter
|
||||||
POSTGRE_ADAPTER_PARENT = USE_ARJDBC_WORKAROUND ? JdbcAdapter : AbstractAdapter
|
POSTGRE_ADAPTER_PARENT = USE_ARJDBC_WORKAROUND ? JdbcAdapter : AbstractAdapter
|
||||||
|
|
||||||
|
@ -39,7 +47,7 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Mysql2Adapter < AbstractAdapter
|
class Mysql2Adapter < MYSQL2_ADAPTER_PARENT
|
||||||
def truncate_table(table_name)
|
def truncate_table(table_name)
|
||||||
execute("TRUNCATE TABLE #{quote_table_name(table_name)};")
|
execute("TRUNCATE TABLE #{quote_table_name(table_name)};")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue