Rails 5'te API, tablolar / görünümler ve toplu olarak veri kaynakları konusunda açık hale geldi .
# Tables and views
ActiveRecord::Base.connection.data_sources
ActiveRecord::Base.connection.data_source_exists? 'kittens'
# Tables
ActiveRecord::Base.connection.tables
ActiveRecord::Base.connection.table_exists? 'kittens'
# Views
ActiveRecord::Base.connection.views
ActiveRecord::Base.connection.view_exists? 'kittens'
Rails 2, 3 ve 4'te API tablolarla ilgilidir .
# Listing of all tables and views
ActiveRecord::Base.connection.tables
# Checks for existence of kittens table/view (Kitten model)
ActiveRecord::Base.connection.table_exists? 'kittens'
Taşımaların durumunu alma:
# Tells you all migrations run
ActiveRecord::Migrator.get_all_versions
# Tells you the current schema version
ActiveRecord::Migrator.current_version
Taşıma işlemleri veya meta veriler için daha fazla API'ya ihtiyacınız varsa bkz: