Gladiator wrote:> I have two tables having many-to-many relationship.
> I created a join table containing the primary keys of both tables.
>
> Can any body tell me how use
> Ruby migration for foreign keys....
>
> Thanks in advance
> Satish
Don''t know what you mean. Do you mean something like this:
....
create_table :magazines_readers, :id => false do |t|
t.column :magazine_id, :integer
t.column :reader_id, :integer
end
(see "Rails Recipes" pag. 104)
for a many-to-many relation between magazines and readers (a magazine
has many readers, a reader reads many magazines).
Roberto Gattinoni.
--
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?hl=en
-~----------~----~----~----~------~----~------~--~---