FIX: `Group#name` is case insensitive.
This commit is contained in:
parent
66b5f97743
commit
7d82a53dfe
|
@ -180,7 +180,7 @@ class Group < ActiveRecord::Base
|
||||||
validator = UsernameValidator.new(localized_name)
|
validator = UsernameValidator.new(localized_name)
|
||||||
|
|
||||||
group.name =
|
group.name =
|
||||||
if !Group.where(name: localized_name).exists? && validator.valid_format?
|
if !Group.where("lower(name) = ?", localized_name).exists? && validator.valid_format?
|
||||||
localized_name
|
localized_name
|
||||||
else
|
else
|
||||||
name
|
name
|
||||||
|
|
|
@ -182,7 +182,7 @@ describe Group do
|
||||||
I18n.locale = SiteSetting.default_locale = 'de'
|
I18n.locale = SiteSetting.default_locale = 'de'
|
||||||
|
|
||||||
another_group = Fabricate(:group,
|
another_group = Fabricate(:group,
|
||||||
name: I18n.t('groups.default_names.staff')
|
name: I18n.t('groups.default_names.staff').upcase
|
||||||
)
|
)
|
||||||
|
|
||||||
group = Group.refresh_automatic_group!(:staff)
|
group = Group.refresh_automatic_group!(:staff)
|
||||||
|
|
Loading…
Reference in New Issue