Skip to content
Snippets Groups Projects
Commit 51b88c7d authored by João Victor Risso's avatar João Victor Risso
Browse files

Implement tables method in SchemaStatements

parent e78ee752
Branches
No related tags found
No related merge requests found
...@@ -27,6 +27,16 @@ module ActiveRecord ...@@ -27,6 +27,16 @@ module ActiveRecord
data_sources.include?(name.to_s) data_sources.include?(name.to_s)
end end
# Returns an array of table names defined in the database.
def tables(name = nil)
if name
ActiveSupport::Deprecation.warn(<<-MSG.squish)
Passing arguments to #tables is deprecated without replacement.
MSG
end
select_values("select tables.name from tables where tables.system = false")
end
# Checks to see if the table +table_name+ exists on the database. # Checks to see if the table +table_name+ exists on the database.
# #
# table_exists?(:developers) # table_exists?(:developers)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment