sailor
sailor

Reputation: 8034

How to populate database with fake data?

I heard about gems like faker or populator but they are a little bit old (populator does not seem to play well with Rails 3).

So my question is, what do you use to generate fixtures ?

Upvotes: 1

Views: 3159

Answers (2)

caulfield
caulfield

Reputation: 1373

If you are interested in new fixture framework for ruby, take a look on Fabrication. It's looks like FactoryGirl Rails but have more interested features. We are using it with Faker and it's fine. I think it's the best solution nowadays :)

Upvotes: 6

MrDanA
MrDanA

Reputation: 11647

Most people use FactoryGirl Rails, which works nicely with Faker for doing things like random names, to make test data during their tests.

If sometimes you just want to populate your Dev DB with some fake data to make your application work, you can still use FactoryGirl Rails and make a Rake task that will populate some data you need.

Upvotes: 3

Related Questions