Skip to content

Commit aac97a2

Browse files
committed
Fix sqlite regressions do to changes in arjdbc abstract classes
1 parent 450359d commit aac97a2

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ nbproject
1919
.project
2020
*.sqlite
2121
*.sqlite3
22+
*.sqlite3-shm
23+
*.sqlite3-wal
2224
*.derby
2325
derby.log
2426
test.hsqldb*

lib/arjdbc/sqlite3/adapter.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,14 @@ class SQLite3Adapter < AbstractAdapter
774774
# config.active_record.sqlite3_adapter_strict_strings_by_default = true
775775
class_attribute :strict_strings_by_default, default: false # Does not actually do anything right now
776776

777+
def initialize(...)
778+
super
779+
780+
conn_params = @config.compact
781+
782+
@connection_parameters = conn_params
783+
end
784+
777785
def self.represent_boolean_as_integer=(value) # :nodoc:
778786
if value == false
779787
raise "`.represent_boolean_as_integer=` is now always true, so make sure your application can work with it and remove this settings."
@@ -817,7 +825,7 @@ def jdbc_column_class
817825
::ActiveRecord::ConnectionAdapters::SQLite3Column
818826
end
819827

820-
def jdbc_connection_class(spec)
828+
def jdbc_connection_class
821829
self.class.jdbc_connection_class
822830
end
823831

test/db/sqlite3.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
require 'test_helper'
22

3-
SQLITE3_CONFIG = { :adapter => 'sqlite3', :database => 'test.sqlite3' }
3+
SQLITE3_CONFIG = {
4+
adapter: 'sqlite3',
5+
database: 'test.sqlite3'
6+
}
7+
48
unless ( ps = ENV['PREPARED_STATEMENTS'] || ENV['PS'] ).nil?
59
SQLITE3_CONFIG[:prepared_statements] = ps
610
end
711
ActiveRecord::Base.establish_connection(SQLITE3_CONFIG)
812

9-
at_exit { Dir['*test.sqlite3'].each { |f| File.delete(f) } }
13+
at_exit { Dir['*test.sqlite3-*'].each { |f| File.delete(f) } }

0 commit comments

Comments
 (0)