I have two models Event and Category in my rails app. I want a join model for many to many association so i used the script ./script/generate migration create_categories_events event_id:integer category_id:integer but the migration that is generated is empty. I am using rails 2.1.1. Can anyone tell me whats the problem here --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Sep 26, 5:05 pm, rick_2047 <rick.chatter...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have two models Event and Category in my rails app. > I want a join model for many to many association so i used the script > > ./script/generate migration create_categories_events event_id:integer > category_id:integer > > but the migration that is generated is empty. I am using rails 2.1.1. > Can anyone tell me whats the problem hereBecause that generator doesn''t try and fill in the migration for you (script/generate model would). More details here: http://guides.rails.info/migrations/migrations.html#_creating_a_migration Fred --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
So what do you suggest i should do create the join table with the model of hand fill it. On Fri, Sep 26, 2008 at 9:22 AM, Frederick Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On Sep 26, 5:05 pm, rick_2047 <rick.chatter...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I have two models Event and Category in my rails app. > > I want a join model for many to many association so i used the script > > > > ./script/generate migration create_categories_events event_id:integer > > category_id:integer > > > > but the migration that is generated is empty. I am using rails 2.1.1. > > Can anyone tell me whats the problem here > > Because that generator doesn''t try and fill in the migration for you > (script/generate model would). More details here: > http://guides.rails.info/migrations/migrations.html#_creating_a_migration > > Fred > > >-- <b>I believe in beautiful ideas, Most of my ideas are of girls.</b> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---