aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors/to_sql.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-12-03 16:01:36 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-03 16:01:36 -0800
commit8a5680e4a75eb6ac877c1c9687a99e021cbba74e (patch)
treeddd395eab62184cd8554828539ff5ed24afe8902 /lib/arel/visitors/to_sql.rb
parent40603729cc1d9a8e636a887446d051390d15fcd8 (diff)
downloadrails-8a5680e4a75eb6ac877c1c9687a99e021cbba74e.tar.gz
rails-8a5680e4a75eb6ac877c1c9687a99e021cbba74e.tar.bz2
rails-8a5680e4a75eb6ac877c1c9687a99e021cbba74e.zip
declawing connection from the Table class
Diffstat (limited to 'lib/arel/visitors/to_sql.rb')
-rw-r--r--lib/arel/visitors/to_sql.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb
index 8db90c376a..082196ef2b 100644
--- a/lib/arel/visitors/to_sql.rb
+++ b/lib/arel/visitors/to_sql.rb
@@ -70,11 +70,12 @@ module Arel
def table_exists? name
return true if @table_exists.key? name
- if @connection.table_exists?(name)
- @table_exists[name] = true
- else
- false
+
+ @connection.tables.each do |table|
+ @table_exists[table] = true
end
+
+ @table_exists.key? name
end
def column_for attr