Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 240f4e9

Browse files
spastorinojeremy
authored andcommittedMay 25, 2010
SQLite: forward compatibility with future driver releases
[#4633] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
1 parent f7e27bd commit 240f4e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -220,20 +220,20 @@ def tables(name = nil) #:nodoc:
220220
SQL
221221

222222
execute(sql, name).map do |row|
223-
row[0]
223+
row['name']
224224
end
225225
end
226226

227227
def columns(table_name, name = nil) #:nodoc:
228228
table_structure(table_name).map do |field|
229-
SQLiteColumn.new(field['name'], field['dflt_value'], field['type'], field['notnull'] == "0")
229+
SQLiteColumn.new(field['name'], field['dflt_value'], field['type'], field['notnull'].to_i == 0)
230230
end
231231
end
232232

233233
def indexes(table_name, name = nil) #:nodoc:
234234
execute("PRAGMA index_list(#{quote_table_name(table_name)})", name).map do |row|
235235
index = IndexDefinition.new(table_name, row['name'])
236-
index.unique = row['unique'] != '0'
236+
index.unique = row['unique'].to_i != 0
237237
index.columns = execute("PRAGMA index_info('#{index.name}')").map { |col| col['name'] }
238238
index
239239
end

0 commit comments

Comments
 (0)
Please sign in to comment.