Last Updated: February 25, 2016
·
987
· welblaud

Faker ‒ Ruby gem for populating a testing database

# great gem for populating testing DB with fake data
# 1. Gemfile > gem 'faker'
# 2. in app file > require 'faker'
# 3. in IRB or in app (actually in IRB probably more useful) according to a previously created Model

1000.times do User.create(:name => Faker::Name.name, :email => Faker::Internet.email) end

Many choices available, see Faker's GitHub repository: Link.

1 Response
Add your response

Or you could use ffaker, which is a rewrite of faker with lots of additions.

over 1 year ago ·