Rails 3: Validate combined values

Bear with me. The way the validates method in ActiveModel works is to look for a Validator. :presence => true looks for PresenceValidator and passes the options: true to the validator’s initializer. I think you want validates :husband, :presence => true, :uniqueness => {:scope => :wife} (The uniqueness validator is actually part of ActiveRecord, not … Read more

validates_uniqueness_of passes on nil or blank (without allow_nil and allow_blank)

You are mistaken about the default behavior. From the docs: :allow_nil – If set to true, skips this validation if the attribute is nil (default is false). :allow_blank – If set to true, skips this validation if the attribute is blank (default is false, it includes nil too). Setting allow_blank to true, I see the … Read more