I have a Rails model with a boolean field that I search on (I use a scope that finds all instances where the field is set to true). I\'m using Postgres.
My instinct
To create the partial index in a Rails migration, you would do this. In this example, the model is Product and the column is featured.
Product
featured
class AddFeaturedOnProducts < ActiveRecord::Migration def change add_index(:products, :featured, where: "featured") end end