rails/rails — pull request #11442 by nberger (2013-07-15 01:57:24+00:00)
Title: Backport #4956 to 3-2-stable. Postgresql partial indices

Added where option to add_index to support postgresql partial indices

The `add_index` method now supports a `where` option that receives a
string with the partial index criteria.

add_index(:accounts, :code, :where => "active")

Generates

CREATE INDEX index_accounts_on_code ON accounts(code) WHERE active

Made schema dumper recognize partial indices' where statements