aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-01-26 13:00:19 -0800
committerYehuda Katz <wycats@Yehuda-Katz.local>2010-01-26 15:09:11 -0800
commitbeda2d43d6ac5c3435fc2fba0cbd108c20fe1c67 (patch)
tree0a03e0fd54501907544498a10a44f87bd45d2a8f /activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
parent6404feee500dc5a2268da1e41af08a5ff847338a (diff)
downloadrails-beda2d43d6ac5c3435fc2fba0cbd108c20fe1c67.tar.gz
rails-beda2d43d6ac5c3435fc2fba0cbd108c20fe1c67.tar.bz2
rails-beda2d43d6ac5c3435fc2fba0cbd108c20fe1c67.zip
future proofing the sqlite3 adapter code
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
index 0a52f3a6a2..29225b83c5 100644
--- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -193,20 +193,20 @@ module ActiveRecord
SQL
execute(sql, name).map do |row|
- row[0]
+ row['name']
end
end
def columns(table_name, name = nil) #:nodoc:
table_structure(table_name).map do |field|
- SQLiteColumn.new(field['name'], field['dflt_value'], field['type'], field['notnull'] == "0")
+ SQLiteColumn.new(field['name'], field['dflt_value'], field['type'], field['notnull'].to_i == 0)
end
end
def indexes(table_name, name = nil) #:nodoc:
execute("PRAGMA index_list(#{quote_table_name(table_name)})", name).map do |row|
index = IndexDefinition.new(table_name, row['name'])
- index.unique = row['unique'] != '0'
+ index.unique = row['unique'].to_i != 0
index.columns = execute("PRAGMA index_info('#{index.name}')").map { |col| col['name'] }
index
end