aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
diff options
context:
space:
mode:
authorkennyj <kennyj@gmail.com>2012-05-19 04:40:36 +0900
committerkennyj <kennyj@gmail.com>2012-05-19 04:53:12 +0900
commit576d7007ddff889d502a77e4868b35d4b0dcc6c7 (patch)
tree7c8e6d03fee4abb31a6ee444382ca38bc17bbe6c /activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
parenta6dbc3fe7a504805572e634d39e37fd63ba7fd45 (diff)
downloadrails-576d7007ddff889d502a77e4868b35d4b0dcc6c7.tar.gz
rails-576d7007ddff889d502a77e4868b35d4b0dcc6c7.tar.bz2
rails-576d7007ddff889d502a77e4868b35d4b0dcc6c7.zip
Fix logs name consistency.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
index d4ffa82b17..a0c7e559ce 100644
--- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
@@ -208,7 +208,6 @@ module ActiveRecord
true
end
-
# QUOTING ==================================================
def quote(value, column = nil)
@@ -220,7 +219,6 @@ module ActiveRecord
end
end
-
def quote_string(s) #:nodoc:
@connection.class.quote(s)
end
@@ -359,7 +357,7 @@ module ActiveRecord
# SCHEMA STATEMENTS ========================================
- def tables(name = 'SCHEMA', table_name = nil) #:nodoc:
+ def tables(name = nil, table_name = nil) #:nodoc:
sql = <<-SQL
SELECT name
FROM sqlite_master
@@ -367,13 +365,13 @@ module ActiveRecord
SQL
sql << " AND name = #{quote_table_name(table_name)}" if table_name
- exec_query(sql, name).map do |row|
+ exec_query(sql, 'SCHEMA').map do |row|
row['name']
end
end
- def table_exists?(name)
- name && tables('SCHEMA', name).any?
+ def table_exists?(table_name)
+ table_name && tables(nil, table_name).any?
end
# Returns an array of +SQLite3Column+ objects for the table specified by +table_name+.
@@ -394,12 +392,12 @@ module ActiveRecord
# Returns an array of indexes for the given table.
def indexes(table_name, name = nil) #:nodoc:
- exec_query("PRAGMA index_list(#{quote_table_name(table_name)})", name).map do |row|
+ exec_query("PRAGMA index_list(#{quote_table_name(table_name)})", 'SCHEMA').map do |row|
IndexDefinition.new(
table_name,
row['name'],
row['unique'] != 0,
- exec_query("PRAGMA index_info('#{row['name']}')").map { |col|
+ exec_query("PRAGMA index_info('#{row['name']}')", "Columns for index #{row['name']} on #{table_name}").map { |col|
col['name']
})
end