instance method
table_exists?
Ruby on Rails 4.2.9
Since v3.2.22.5 Last seen in v4.2.9Signature
table_exists?(name)
No documentation comment.
Parameters
-
namereq
Source
# File activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb, line 420
def table_exists?(name)
return false unless name.present?
return true if tables(nil, nil, name).any?
name = name.to_s
schema, table = name.split('.', 2)
unless table # A table was provided without a schema
table = schema
schema = nil
end
tables(nil, schema, table).any?
end
Defined in activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb line 420
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter