This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

first commit

  • Loading branch information...
kyohsuke committed Oct 10, 2012
1 parent 678a271 commit 6f4112a05b7c2cf5ddcdac515733405b00572f2e
Showing with 27 additions and 2 deletions.
  1. +18 −2 README.md
  2. +9 −0 lib/arb_indexes.rb
View
@@ -1,4 +1,20 @@
-arb_indexes
+# arb_indexes - get indexes from Model
===========
-get defined indexes from Model
+## Usage
+put the Gemfile
+```ruby
+group :development do
+ gem 'arb_indexes', :git => 'git://github.com/kyohsuke/arb_indexes.git'
+end
+```
+
+kick it on rails console
+
+```ruby
+User.indexes
+```
+
+
+## See Also
+http://stackoverflow.com/questions/1683948/activerecord-finding-existing-table-indexes
View
@@ -0,0 +1,9 @@
+module ActiveRecord
+ class Base
+ class << self
+ def indexes
+ connection.indexes(table_name)
+ end
+ end
+ end
+end

0 comments on commit 6f4112a

Please sign in to comment.