File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change 1
- # This file should contain all the record creation needed to seed the database with its default values.
2
- # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
3
- #
4
- # Examples:
5
- #
6
- # movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
7
- # Character.create(name: "Luke", movie: movies.first)
1
+ # Create a main sample user.
2
+ User . create! ( name : "Example User" ,
3
+
4
+ password : "foobar" ,
5
+ password_confirmation : "foobar" )
6
+
7
+ # Generate a bunch of additional users.
8
+ 99 . times do |n |
9
+ name = Faker ::Name . name
10
+ email = "example-#{ n +1 } @railstutorial.org"
11
+ password = "password"
12
+ User . create! ( name : name ,
13
+ email : email ,
14
+ password : password ,
15
+ password_confirmation : password )
16
+ end
You can’t perform that action at this time.
0 commit comments