instance method
table_exists?
Ruby on Rails 5.0.7.2
Since v4.2.11.3 Last seen in v5.0.7.2Available in: v4.2.11.3 v5.0.7.2
Signature
table_exists?(name)
Returns true if table exists. If the schema is not specified as part of name then it will only find tables within the current schema search path (regardless of permissions to access tables in other schemas)
Parameters
-
namereq
Source
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb, line 97
def table_exists?(name)
ActiveSupport::Deprecation.warn(<<-MSG.squish)
#table_exists? currently checks both tables and views.
This behavior is deprecated and will be changed with Rails 5.1 to only check tables.
Use #data_source_exists? instead.
MSG
data_source_exists?(name)
end
Defined in activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb line 97
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements