Is it possible to create unique constraints on active record with value of field.
So this code will add a constraints of 2 columns:
add_index :my_table,[:field_1,:field_2],:unique => true
But I would like to have the same constrains where field_2 == true
For example something like this
add_index :my_table,[:field_1,:field_2 => true],:unique => true
Is it possible ? I saw that it is possible on postgres