Validates_uniqueness_of problem

hi

Could I check to strings for uniqueness together and not individually?
That means for me in an example:

name: sex: result:


miller m unique
miller f unique
jackson m unique
miller m isn’t unique

So I want to check the name and sex be together unique. The name isn’t
individually. Because when I use the following codelines, the third
entry in the example isn’t unique, but I would!

validates_uniqueness_of :name
validates_uniqueness_of :sex

thx for your help!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs