validates_uniqueness_of with conditions

I don't think it can be done. I see two options:

* Write your own validate method * Create another column in the table that would have the a single value for all rows with status 1-4 and use that in the :scope option of validates_uniqueness_of. You could manage this column automatically via before_save.