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.
Written by Honza Hejzl
Related protips
1 Response
Or you could use ffaker, which is a rewrite of faker with lots of additions.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#