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.
This commit is contained in:
parent
c08d31b528
commit
43bd628e05
|
@ -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
|
||||
end
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module ActiveRecord::Import::Sqlite3Adapter
|
||||
module ActiveRecord::Import::SQLite3Adapter
|
||||
def next_value_for_sequence(sequence_name)
|
||||
%{nextval('#{sequence_name}')}
|
||||
end
|
||||
|
|
|
@ -50,3 +50,13 @@ describe "ActiveRecord::ConnectionAdapter::AbstractAdapter" do
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
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::' + connection.class.name.demodulize
|
||||
assert_include connection.class.ancestors, import_class_name.constantize
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue