Browse files

Fixes case-sensitive SQLite3 adapter name typos.

The SQLite3 adapter name was referenced as
`ActiveRecord::ConnectionAdapters::Sqlite3Adapter`, but the
ActiveRecord class is spelled `SQLite3Adapter` (upper-case "SQL"). As
a result, `active_record/adapters/sqlite3_adapter.rb` wasn't actually
including the methods from `adapters/sqlite3_adapter.rb` into the AR
adapter class.

This adds a test for proper inheritance and fixes the spelling of
`SQLite3Adapter`, unifying all references to the ActiveRecord version.
  • Loading branch information...
1 parent c08d31b commit 43bd628e0578974b7c22d712932554243daaf258 @mildmojo mildmojo committed Oct 1, 2012
@@ -1,7 +1,7 @@
require "active_record/connection_adapters/sqlite3_adapter"
require "activerecord-import/adapters/sqlite3_adapter"
-class ActiveRecord::ConnectionAdapters::Sqlite3Adapter
- include ActiveRecord::Import::Sqlite3Adapter
+class ActiveRecord::ConnectionAdapters::SQLite3Adapter
+ include ActiveRecord::Import::SQLite3Adapter
@@ -1,4 +1,4 @@
-module ActiveRecord::Import::Sqlite3Adapter
+module ActiveRecord::Import::SQLite3Adapter
def next_value_for_sequence(sequence_name)
@@ -50,3 +50,13 @@
+describe "ActiveRecord::Import DB-specific adapter class" do
+ context "when ActiveRecord::Import is in use" do
+ it "should appear in the AR connection adapter class's ancestors" do
+ connection = ActiveRecord::Base.connection
+ import_class_name = 'ActiveRecord::Import::' +
+ assert_include connection.class.ancestors, import_class_name.constantize
+ end
+ end

0 comments on commit 43bd628

Please sign in to comment.