Hi there,

At the moment, I have a mobile phone field in my table. It is not
compulsory for the user to provide a mobile phone number, however you
cannot have 2 users with the same mobile phone.

Therefore, I would like to allow nulls, but enforce uniqueness on any
non-blank records. I'm currently using this:
:validations => {:unique => true, :nullable => true})

However, understandably, this also enforces uniqueness on nils, so you
can only have one record with a blank mobile phone number.

I'm not sure how best to achieve what I'm trying to do, so if anyone
has any suggestions it would be greatly appreciated.

Thanks,
Emily


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to