OK, think I've figured this out. Looks like 'validates_is_unique :attr_name, :allow_nil => true' does what I need.
Mark. MarkMT wrote: > Is there a simple way to validate that an attribute is unique only if > it's not nil? i.e. it's fine for the attribute to be nil in multiple > records, but any non-nil value must only occur once. > > Mark. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" 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/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
