Class: SchemaController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/schema_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
7
8
9
10
11
12
13
# File 'app/controllers/schema_controller.rb', line 4

def index
  conn = ActiveRecord::Base.connection
  @tables = (conn.tables - %w[schema_migrations ar_internal_metadata]).sort.map do |table_name|
    {
      name: table_name,
      columns: conn.columns(table_name),
      indexes: conn.indexes(table_name)
    }
  end
end