2013-09-06 03:03:30 -05:00
|
|
|
# kind of odd, but we need it, we also need to nuke usage of User from inside migrations
|
|
|
|
# very poor form
|
2014-05-06 08:41:59 -05:00
|
|
|
user = User.find_by("id <> -1 and username_lower = 'system'")
|
2013-09-05 23:07:23 -05:00
|
|
|
if user
|
2013-09-06 02:28:37 -05:00
|
|
|
user.username = UserNameSuggester.suggest("system")
|
2013-09-05 23:07:23 -05:00
|
|
|
user.save
|
|
|
|
end
|
|
|
|
|
|
|
|
User.seed do |u|
|
|
|
|
u.id = -1
|
2013-09-06 02:28:37 -05:00
|
|
|
u.name = "system"
|
|
|
|
u.username = "system"
|
|
|
|
u.username_lower = "system"
|
|
|
|
u.email = "no_email"
|
2013-09-05 23:07:23 -05:00
|
|
|
u.password = SecureRandom.hex
|
|
|
|
u.active = true
|
|
|
|
u.admin = true
|
|
|
|
u.moderator = true
|
|
|
|
u.email_direct = false
|
|
|
|
u.approved = true
|
|
|
|
u.email_private_messages = false
|
2014-01-21 08:21:38 -06:00
|
|
|
u.trust_level = TrustLevel.levels[:elder]
|
2013-09-05 23:07:23 -05:00
|
|
|
end
|
2014-06-16 19:46:30 -05:00
|
|
|
|
|
|
|
Group.user_trust_level_change!(-1 ,TrustLevel.levels[:elder])
|