JB, I think you would need to use a scope, for example:
validates_uniqueness_of :user_id, :scope => :design_id
On Nov 18, 4:47 pm, Jables
<brun3...-Meo6Lv8EUjg3uPMLIKxrzw@public.gmane.org>
wrote:> Given three models: a design model, a votes model, and a users model
> the problem is a user can only vote for a design once.
>
> If I do a validates_uniqueness_of :user in the votes model that means
> a user can only vote once, period. What I want is to say a user can
> only vote for a single design once. Anyone know the best way to do
> this? Thanks.
>
> JB
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---