Skip to content

Commit 709051d

Browse files
committed
align SQLite's column class resolution with others in 1.3
1 parent 2395438 commit 709051d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/arjdbc/sqlite3/adapter.rb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ def self.jdbc_connection_class
1212
::ActiveRecord::ConnectionAdapters::SQLite3JdbcConnection
1313
end
1414

15+
def jdbc_column_class; ::ActiveRecord::ConnectionAdapters::SQLite3Column end
16+
1517
# @see ActiveRecord::ConnectionAdapters::JdbcColumn#column_types
1618
def self.column_selector
1719
[ /sqlite/i, lambda { |config, column| column.extend(Column) } ]
@@ -348,15 +350,15 @@ def table_structure(table_name)
348350

349351
# @override
350352
def columns(table_name, name = nil)
351-
klass = ::ActiveRecord::ConnectionAdapters::SQLite3Column
353+
column = jdbc_column_class
352354
pass_cast_type = respond_to?(:lookup_cast_type)
353355
table_structure(table_name).map do |field|
354356
sql_type = field['type']
355357
if pass_cast_type
356358
cast_type = lookup_cast_type(sql_type)
357-
klass.new(field['name'], field['dflt_value'], cast_type, sql_type, field['notnull'] == 0)
359+
column.new(field['name'], field['dflt_value'], cast_type, sql_type, field['notnull'] == 0)
358360
else
359-
klass.new(field['name'], field['dflt_value'], sql_type, field['notnull'] == 0)
361+
column.new(field['name'], field['dflt_value'], sql_type, field['notnull'] == 0)
360362
end
361363
end
362364
end
@@ -592,10 +594,6 @@ def jdbc_connection_class(spec)
592594
::ArJdbc::SQLite3.jdbc_connection_class
593595
end
594596

595-
def jdbc_column_class
596-
::ActiveRecord::ConnectionAdapters::SQLite3Column
597-
end
598-
599597
# @private
600598
Version = ArJdbc::SQLite3::Version
601599

0 commit comments

Comments
 (0)