search for: campaigns_us

Displaying 1 result from an estimated 1 matches for "campaigns_us".

2012 Jan 30
4
Reaching into a has_and_belongs_to_many - will :through work?
...e that I''ve just gotten my syntax wrong and I can in fact do what I want to do. I''ve got a Group, and a Group has_many Campaigns. Campaign has_and_belongs_to_many Users (and, naturally, vice versa). So I''ve got a groups table, a campaigns table (that has a group_id), a campaigns_users join table (with campaign_id and user_id), and a users table (who basically is left not belonging to anyone). My question is this -- starting from Group I want to reach through that HABTM and point directly at the Users who belong to this Group. I''ve successfully done it by writing my...