instance method
table_exists?
Ruby on Rails 3.1.12
Since v3.1.12 Last seen in v3.1.12Signature
table_exists?(name)
No documentation comment.
Parameters
-
namereq
Source
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 432
def table_exists?(name)
return true if super
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).include? table
end
Defined in activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb line 432
· View on GitHub
· Improve this page
· Find usages on GitHub