Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.

Commit ee5107c

Browse files
committed
Add Faker gem and seeds
1 parent d038df7 commit ee5107c

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,5 @@ group :development, :test do
5454

5555
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
5656
gem 'spring'
57+
gem 'faker'
5758
end

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ GEM
6161
railties (~> 4.0)
6262
erubis (2.7.0)
6363
execjs (2.6.0)
64+
faker (1.6.6)
65+
i18n (~> 0.5)
6466
faraday (0.9.1)
6567
multipart-post (>= 1.2, < 3)
6668
ffi (1.9.18)
@@ -211,6 +213,7 @@ DEPENDENCIES
211213
byebug
212214
coffee-rails (~> 4.1.0)
213215
dotenv-rails
216+
faker
214217
gemoji
215218
haml-rails (~> 0.9)
216219
jbuilder (~> 2.0)

db/seeds.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,19 @@
55
#
66
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
77
# Mayor.create(name: 'Emanuel', city: cities.first)
8+
9+
10.times do
10+
User.create(
11+
name: Faker::Name.name,
12+
email: "#{Faker::Internet.email.split("@").first}@#{ENV['EMAIL_WHITELIST']}",
13+
image: Faker::Avatar.image
14+
)
15+
end
16+
17+
20.times do
18+
Compliment.create(
19+
complimenter: User.order("RANDOM()").first,
20+
complimentee: User.order("RANDOM()").first,
21+
text: Faker::Lorem.sentence
22+
)
23+
end

0 commit comments

Comments
 (0)