Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Prevent multiple SHOW TABLES calls when a table don't exists in datab…

…ase.
  • Loading branch information...
commit 27c5800c9cf8c19c3deb8bb6ebc1186d0f865d69 1 parent 7352efa
@noefroidevaux noefroidevaux authored
View
6 activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -123,14 +123,14 @@ def initialize(spec)
# A cached lookup for table existence.
def table_exists?(name)
- return true if @tables.key? name
+ return @tables[name] if @tables.key? name
with_connection do |conn|
conn.tables.each { |table| @tables[table] = true }
- @tables[name] = true if !@tables.key?(name) && conn.table_exists?(name)
+ @tables[name] = !@tables.key?(name) && conn.table_exists?(name)
end
- @tables.key? name
+ @tables[name]
end
# Clears out internal caches:
Please sign in to comment.
Something went wrong with that request. Please try again.