Jack Dempsey
2006-Aug-24 02:42 UTC
[Rails] restricting has_many associations to one relation
Hi All, I''m just getting familiar with has_many :through usage, and something became apparent quickly: there was nothing preventing the same relation from being inserted into my join table multiple times. group_id user_id ------- ------ 1 1 1 1 etc. would happen upon many refreshings of the post. I can think of several ways to prevent this from happening, but what is the best Rails way of doing it? (a unique index on the table feels like cheating...) Any thoughts or pointers? Thanks! Jack -- 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 -~----------~----~----~----~------~----~------~--~---