you have to create it with a migration (or by hand, phpmyadmin, or
some other software)
example:
Model 1: Post
Model 2: Authror
Join table:
authors_posts
Rule for the table name: order of model names alphabetically. both
model names pluralized
generally i suggest has_many_through over has_and_belongs_to_many, as
it let''s you access the join table thorugh it''s own model...
On 12 Jun., 11:26, psimoes
<pedro.a.sim...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hello,
>
> Suppose I have the following tables:
>
> table X (
> id
> name
> )
>
> table Y (
> id
> name
> )
>
> And I have a many to many relation between them. So, I put in each of
> the tables the "has_and_belongs_to_many". In the real database it
> should be a X_Y join table. Do I have to create that table with a
> migration or the model will take care of that?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---