instance method
table_exists?
Ruby on Rails 3.1.12
Since v3.1.12 Last seen in v3.1.12Signature
table_exists?(name)
A cached lookup for table existence.
Parameters
-
namereq
Source
# File activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb, line 125
def table_exists?(name)
return true 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)
end
@tables.key? name
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb line 125
· View on GitHub
· Improve this page
· Find usages on GitHub