Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #153 from scottwillson/master

Use correct SQLite3Adapter superclass in Rails 4
  • Loading branch information...
commit 9f898fc50d87a5d51760f9dcf374bf5ffda21baf 2 parents f80af0d + 650bb11
@bmabey bmabey authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/database_cleaner/active_record/truncation.rb
View
6 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
Please sign in to comment.
Something went wrong with that request. Please try again.