hi all, has_and_belongs_to_many :cows has_and_belongs_to_many :milkmans i am using has_and_belongs_to_many in my app.I know this will create third table internally cows_milkmans in mysql database. when i migrate develpoment database i have table cows_milkmans. Good no Problem till now. Now a problem start When i migrate test database there is no such cows_milkmans table is present.. And we all know that has_and_belongs_to_many not generate any migrate file. What should i do now? how to generate third table in test database ? If there is no solution than i know that i have to create cows_milkmans table manually . Thanks Fahim Babar Patel -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/_Zwg_Tlex5wJ. For more options, visit https://groups.google.com/groups/opt_out.
On 12 September 2012 08:57, Fahim Patel <pafahim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hi all, > > has_and_belongs_to_many :cows > has_and_belongs_to_many :milkmans > > i am using has_and_belongs_to_many in my app.I know this will create third > table internally cows_milkmans in mysql database. > > when i migrate develpoment database i have table cows_milkmans. Good no > Problem till now. > > Now a problem start When i migrate test database there is no such > cows_milkmans table is present.. > And we all know that has_and_belongs_to_many not generate any migrate > file. > > What should i do now? > how to generate third table in test database ? > If there is no solution than i know that i have to create cows_milkmans > table manually .There is no need to run migrate on the test db. rake db:test:prepare will create or update the test database to the same state as the development db. Colin> > Thanks > Fahim Babar Patel > > > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/_Zwg_Tlex5wJ. > For more options, visit https://groups.google.com/groups/opt_out. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 12 September 2012 09:53, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 12 September 2012 08:57, Fahim Patel <pafahim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> hi all, >> >> has_and_belongs_to_many :cows >> has_and_belongs_to_many :milkmans >> >> i am using has_and_belongs_to_many in my app.I know this will create third >> table internally cows_milkmans in mysql database. >> >> when i migrate develpoment database i have table cows_milkmans. Good no >> Problem till now. >> >> Now a problem start When i migrate test database there is no such >> cows_milkmans table is present.. >> And we all know that has_and_belongs_to_many not generate any migrate >> file. >> >> What should i do now? >> how to generate third table in test database ? >> If there is no solution than i know that i have to create cows_milkmans >> table manually . > > There is no need to run migrate on the test db. > rake db:test:prepare > will create or update the test database to the same state as the development db.Also have a look at the Rails Guide on Testing for more information. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Seemingly Similar Threads
- wat is diff between webrat and capybara?????
- How to test recaptcha in localhost?
- How to use Ajax with rails ?
- Could not find gem 'nileshtrivedi-gupshup (>= 0) ruby' in the gems available on this machine.
- What is Formtastic and SimpleForm gem ? Is any one of this is by default included in Rails ?