Thanks.
  I just got it working by doing this:

has_and_belongs_to_many :users,
:join_table => "projects_roles_users",
:foreign_key => 'role_id',
:association_foreign_key => 'project_id',
:insert_sql => 'INSERT INTO
            projects_roles_users(project_id,role_id,user_id)
            VALUES(#{id}, #{role_ids}, #{user_ids})'


On Feb 17, 6:20 pm, Walter Lee Davis <[email protected]> wrote:
> I did something similar using an Observer to create the join object.  
> The reason for this was that I needed to create a join when either one  
> side was created or the other side was. So in one Observer, I could  
> watch both models, and respond to either one.
>
> Walter
>
> On Feb 17, 2011, at 6:21 PM, macro wrote:
>
> > Should I simply do it some other way?
>
> > --
> > 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-
> > [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected]
> > .
> > For more options, visit this group 
> > athttp://groups.google.com/group/rubyonrails-talk?hl=en
> > .

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to