Sha256: a2debcb15aa2455a94109626d6a09b301343d22935bfe48157fd6af83cfa9d5e

Contents?: true

Size: 764 Bytes

Versions: 20

Compression:

Stored size: 764 Bytes

Contents

module AdminData
  class TableStructureController < ApplicationController

    before_filter :get_class_from_params

    def index
      @page_title = 'table_structure'
      @indexes = []
      if (indexes = ActiveRecord::Base.connection.indexes(@klass.table_name)).any?
        add_index_statements = indexes.map do |index|
          statment_parts = [ ('add_index ' + index.table.inspect) ]
          statment_parts << index.columns.inspect
          statment_parts << (':name => ' + index.name.inspect)
          statment_parts << ':unique => true' if index.unique

          '  ' + statment_parts.join(', ')
        end
        add_index_statements.sort.each { |index| @indexes << index }
      end
      respond_to {|format| format.html}
    end

  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
the_jobbook_admin_data-1.3.0a app/controllers/admin_data/table_structure_controller.rb
admin_data-1.2.1 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.2.0 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.16 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.15 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.14 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.13 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.12 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.11 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.10 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.9 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.8 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.7 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.6 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.5 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.4 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.3 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.2 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.1 app/controllers/admin_data/table_structure_controller.rb
admin_data-1.1.0 app/controllers/admin_data/table_structure_controller.rb