===========
put the Gemfile
group :development do
gem 'arb_indexes', :git => 'git://github.com/kyohsuke/arb_indexes.git'
end
kick it on rails console
User.indexes #=>
[#<struct ActiveRecord::ConnectionAdapters::IndexDefinition
table="users",
name="index_users_on_screen_name",
unique=false,
columns=["screen_name"],
lengths=[nil],
orders=nil>]
touch config/initializers/arb_indexes.rb and put it.
module ActiveRecord
class Base
class << self
def indexes
connection.indexes(table_name)
end
end
end
end
http://stackoverflow.com/questions/1683948/activerecord-finding-existing-table-indexes
Please "+1" this answer if you like.
MIT