What is the preferred way to have testing data - fixtures, or something like factory_girl (https://github.com/thoughtbot/ factory_girl)? I definitely need something that can handle relationships between things - for example, an article belongs to a section / a section has many articles. Also, how do people generally load seed data? I know about rake db:seed...but do people generally load something (like fixtures) in the seeds.rb file instead of typing out all this stuff in there? There must be a clean way to handle all of this! I think I''m going to try factory_girl if no one has major objections... -- 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
daze wrote in post #966672:> What is the preferred way to have testing data - fixtures, or > something like factory_girl (https://github.com/thoughtbot/ > factory_girl)?Factories. Never use fixtures, ever, for anything.> > I definitely need something that can handle relationships between > things - for example, an article belongs to a section / a section has > many articles.If you had checked the documentation for Factory Girl and Machinist, you would know that they can do this.> > Also, how do people generally load seed data? I know about rake > db:seed...but do people generally load something (like fixtures) in > the seeds.rb file instead of typing out all this stuff in there? > There must be a clean way to handle all of this!There is. The seeds.rb file or the seed_fu plugin.> > I think I''m going to try factory_girl if no one has major objections...Yes, do try that or Machinist. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hey thanks! Just like to say that factory_girl_rails (factory_girl for Rails 3) works excellently. On Dec 6, 5:24 pm, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> daze wrote in post #966672: > > > What is the preferred way to have testing data - fixtures, or > > something like factory_girl (https://github.com/thoughtbot/ > > factory_girl)? > > Factories. Never use fixtures, ever, for anything. > > > > > I definitely need something that can handle relationships between > > things - for example, an article belongs to a section / a section has > > many articles. > > If you had checked the documentation for Factory Girl and Machinist, you > would know that they can do this. > > > > > Also, how do people generally load seed data? I know about rake > > db:seed...but do people generally load something (like fixtures) in > > the seeds.rb file instead of typing out all this stuff in there? > > There must be a clean way to handle all of this! > > There is. The seeds.rb file or the seed_fu plugin. > > > > > I think I''m going to try factory_girl if no one has major objections... > > Yes, do try that or Machinist. > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.