dino d. wrote: > Hi - I want to allow duplicate fields values if the field is blank, > but disallow duplicates if it's not. Is there a > validates_uniqueness_of_if_present equivalent? > > Thanks, > Dino
Hi, As you required to place duplicate value if field is blank than you just use validates_uniqueness_of :field_name,:allow_blank => 'true' :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). -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

