Permalink
Browse files

Merge pull request #153 from scottwillson/master

Use correct SQLite3Adapter superclass in Rails 4
  • Loading branch information...
bmabey committed Feb 15, 2013
2 parents f80af0d + 650bb11 commit 9f898fc50d87a5d51760f9dcf374bf5ffda21baf
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/database_cleaner/active_record/truncation.rb
@@ -195,7 +195,11 @@ class SQLiteAdapter < AbstractAdapter
MYSQL2_ADAPTER_PARENT = AbstractAdapter
end
- SQLITE_ADAPTER_PARENT = USE_ARJDBC_WORKAROUND ? JdbcAdapter : SQLiteAdapter
+ if defined?(SQLite3Adapter) && SQLite3Adapter.superclass == ActiveRecord::ConnectionAdapters::AbstractAdapter
+ SQLITE_ADAPTER_PARENT = USE_ARJDBC_WORKAROUND ? JdbcAdapter : AbstractAdapter
+ else
+ SQLITE_ADAPTER_PARENT = USE_ARJDBC_WORKAROUND ? JdbcAdapter : SQLiteAdapter
+ end
POSTGRE_ADAPTER_PARENT = USE_ARJDBC_WORKAROUND ? JdbcAdapter : AbstractAdapter
class MysqlAdapter < MYSQL_ADAPTER_PARENT

0 comments on commit 9f898fc

Please sign in to comment.