Joshua Muheim
2006-Sep-30 09:50 UTC
Receive external parameters when doing "rake migrate"?
Hi all In my migrations I oftenly add some data to the created tables. Sometimes it''s fix data that should be generated also when going productive; e.g. a list of countries. But sometimes it is data that is just for testing purposes in the development environment. Now I''d like to send a parameter that determines whether to create the test data when calling rake: $ rake migrate TEST_DATA=1 Or something like that. How can this be achieved? Thanks for help, Joshua -- 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 -~----------~----~----~----~------~----~------~--~---
Vishnu Gopal
2006-Sep-30 13:22 UTC
Re: Receive external parameters when doing "rake migrate"?
ENV["TEST_DATA"] should access it from your migration. Vish On 9/30/06, Joshua Muheim <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hi all > > In my migrations I oftenly add some data to the created tables. > Sometimes it''s fix data that should be generated also when going > productive; e.g. a list of countries. > > But sometimes it is data that is just for testing purposes in the > development environment. Now I''d like to send a parameter that > determines whether to create the test data when calling rake: > > $ rake migrate TEST_DATA=1 > > Or something like that. How can this be achieved? > > Thanks for help, > Joshua > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Joshua Muheim
2006-Sep-30 13:33 UTC
Re: Receive external parameters when doing "rake migrate"?
Vishnu Gopal wrote:> ENV["TEST_DATA"] should access it from your migration. > > VishThanks a lot :-) -- 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 -~----------~----~----~----~------~----~------~--~---