rails/rails — pull request #17229 by cristianbica (2014-10-10 07:10:19+00:00)
Title: Support operator class on PostgreSQL index creation

The use case for this is for example when you try to create a gin/gist index on a text column. Before this PR I had to do:
```ruby
class AddFulltextIndexesToUsers < ActiveRecord::Migration
def up
execute <<-SQL
CREATE INDEX "index_users_on_bio" ON "users" USING gin ("bio" gin_trgm_ops)
SQL
end

def down
execute <<-SQL
DROP INDEX "index_users_on_bio"
SQL
end
end
```

now I can do

```ruby
class AddFulltextIndexesToUsers < ActiveRecord::Migration
def change
add_index :users, :bio, using: 'gin', opclass: "gin_trgm_ops"
end
end
```