forked from lobsters/lobsters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
seeds.rb
33 lines (30 loc) · 922 Bytes
/
seeds.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
pwd = SecureRandom.base58
User.create(
:username => "inactive-user",
:email => "inactive-user@example.com",
:password => pwd,
:password_confirmation => pwd
)
User.create(
:username => "test",
:email => "test@example.com",
:password => "test",
:password_confirmation => "test",
:is_admin => true,
:is_moderator => true,
:karma => [
User::MIN_KARMA_TO_SUGGEST,
User::MIN_KARMA_TO_DOWNVOTE,
User::MIN_KARMA_TO_SUBMIT_STORIES,
User::MIN_KARMA_FOR_INVITATION_REQUESTS
].max,
:created_at => User::NEW_USER_DAYS.days.ago
)
Tag.create(:tag => "test")
puts "created:"
puts " * an admin with username/password of test/test"
puts " * inactive-user for disowned comments by deleted users"
puts " * a test tag"
puts
puts "If this is a dev environment, you probably want to run `rails fake_data`"
puts "If this is production, you want to run `rails console` to rename your admin and tag"