I have organizations and individuals. Both of these can have multiply
urls, emails, addresses or phones...so I have used a join table. I also
have codes - WK - work, HM - Home...etc. I need to validate that an
individual or oranization can only have one type of email, phone...etc.
For example an individual can only have multiple email address but only
one with type "WK". How would I validate this accross the join table.
In the email model I have this:
validates_uniqueness_of :type_cd, :scope => "individual_id"
but it doesn''t seem to know about individual_id in this context???
thanks
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---