2013-09-06 16:03:30 +08:00
|
|
|
# kind of odd, but we need it, we also need to nuke usage of User from inside migrations
|
|
|
|
# very poor form
|
|
|
|
User.reset_column_information
|
2013-09-06 15:28:37 +08:00
|
|
|
user = User.where("id <> -1 and username_lower = 'system'").first
|
2013-09-06 12:07:23 +08:00
|
|
|
if user
|
2013-09-06 15:28:37 +08:00
|
|
|
user.username = UserNameSuggester.suggest("system")
|
2013-09-06 12:07:23 +08:00
|
|
|
user.save
|
|
|
|
end
|
|
|
|
|
|
|
|
User.seed do |u|
|
|
|
|
u.id = -1
|
2013-09-06 15:28:37 +08:00
|
|
|
u.name = "system"
|
|
|
|
u.username = "system"
|
|
|
|
u.username_lower = "system"
|
|
|
|
u.email = "no_email"
|
2013-09-06 12:07:23 +08:00
|
|
|
u.password = SecureRandom.hex
|
2013-09-06 15:28:37 +08:00
|
|
|
# TODO localize this, its going to require a series of hacks
|
|
|
|
u.bio_raw = "Not a real person. A global user for system notifications and other system tasks."
|
2013-09-06 12:07:23 +08:00
|
|
|
u.active = true
|
|
|
|
u.admin = true
|
|
|
|
u.moderator = true
|
|
|
|
u.email_direct = false
|
|
|
|
u.approved = true
|
|
|
|
u.email_private_messages = false
|
2014-01-21 22:21:38 +08:00
|
|
|
u.trust_level = TrustLevel.levels[:elder]
|
2013-09-06 12:07:23 +08:00
|
|
|
end
|