Rails code snippet for the day: validates_uniqueness_of_set. Useful for making sure each specific combination of the specified attributes is unique. Example from the pastie:
validates_uniqueness_of_set :first_name, :last_name
Just like the options it accepts, the code is very similar to
validates_uniqueness_of – and the few tests I’ve thrown at it are handled without any problems.