FIX: Some default group names could not be translated

This commit is contained in:
Gerhard Schlager
2014-09-05 00:15:37 +02:00
parent 5b892df2b4
commit 970aafecb4
4 changed files with 11 additions and 6 deletions

View File

@@ -70,10 +70,6 @@ class Group < ActiveRecord::Base
group.save!
end
# the everyone group is special, it can include non-users so there is no
# way to have the membership in a table
return group if name == :everyone
group.name = I18n.t("groups.default_names.#{name}")
# don't allow shoddy localization to break this
@@ -82,6 +78,13 @@ class Group < ActiveRecord::Base
group.name = name
end
# the everyone group is special, it can include non-users so there is no
# way to have the membership in a table
if name == :everyone
group.save!
return group
end
# Remove people from groups they don't belong in.
#
# BEWARE: any of these subqueries could match ALL the user records,