seeds added

This commit is contained in:
ohsab 2014-12-09 18:46:56 +01:00
parent bb234d7463
commit b47a2c08dd
3 changed files with 28 additions and 0 deletions

View file

@ -71,3 +71,6 @@ gem 'devise'
# Use cancan for authorization
gem 'cancan'
#ik wil test data maken dus dit
gem 'faker', '1.4.2'

View file

@ -78,6 +78,8 @@ GEM
warden (~> 1.2.3)
erubis (2.7.0)
execjs (2.2.2)
faker (1.4.2)
i18n (~> 0.5)
hike (1.2.3)
i18n (0.6.11)
jbuilder (2.2.5)
@ -179,6 +181,7 @@ DEPENDENCIES
capistrano-rvm
coffee-rails (~> 4.0.0)
devise
faker (= 1.4.2)
jbuilder (~> 2.0)
jquery-rails
mysql2

View file

@ -5,3 +5,25 @@
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
User.create!(name: "Mats",
nickname: "Basho",
last_name: "Myncke",
email: "mmyncke@gmail.com",
password: "banaan12",
password_confirmation: "banaan12")
99.times do |n|
name = Faker::Name.first_name
nickname = Faker::Name.title
last_name = Faker::Name.last_name
email = Faker::Internet.email
password = "password"
User.create!(name: name,
nickname: nickname,
last_name: last_name,
email: email,
password: password,
password_confirmation: password)
end