You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DataMapper
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.
MarkMT
unread,
May 14, 2009, 4:56:58 PM5/14/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DataMapper
OK, think I've figured this out. Looks like
'validates_is_unique :attr_name, :allow_nil => true' does what I need.