FIX: there is no trust_level_5

This commit is contained in:
Sam 2014-07-10 12:17:13 +10:00
parent 2f8d139ec0
commit c5d3db9148
2 changed files with 6 additions and 4 deletions

View file

@ -21,11 +21,10 @@ class Group < ActiveRecord::Base
:trust_level_1 => 11,
:trust_level_2 => 12,
:trust_level_3 => 13,
:trust_level_4 => 14,
:trust_level_5 => 15
:trust_level_4 => 14
}
AUTO_GROUP_IDS = Hash[*AUTO_GROUPS.to_a.reverse]
AUTO_GROUP_IDS = Hash[*AUTO_GROUPS.to_a.flatten.reverse]
ALIAS_LEVELS = {
:nobody => 0,
@ -90,7 +89,7 @@ class Group < ActiveRecord::Base
"SELECT u.id FROM users u WHERE u.moderator"
when :staff
"SELECT u.id FROM users u WHERE u.moderator OR u.admin"
when :trust_level_1, :trust_level_2, :trust_level_3, :trust_level_4, :trust_level_5
when :trust_level_1, :trust_level_2, :trust_level_3, :trust_level_4
"SELECT u.id FROM users u WHERE u.trust_level >= #{id-10}"
when :trust_level_0
"SELECT u.id FROM users u"

View file

@ -1 +1,4 @@
Group.ensure_automatic_groups!
if g = Group.find_by(name: 'trust_level_5', id: 15)
g.destroy!
end