DEV: Lint file

Ruby in warning mode complains about `foo *[]` instead `foo(*[])` is
preferred
This commit is contained in:
Sam Saffron 2020-08-31 08:52:01 +10:00
parent b4c5f6631f
commit 8ca8a7edba
No known key found for this signature in database
GPG Key ID: B9606168D2FFD9F5
1 changed files with 6 additions and 6 deletions

View File

@ -273,8 +273,8 @@ class User < ActiveRecord::Base
def self.editable_user_custom_fields(by_staff: false)
fields = []
fields.push *DiscoursePluginRegistry.self_editable_user_custom_fields
fields.push *DiscoursePluginRegistry.staff_editable_user_custom_fields if by_staff
fields.push(*DiscoursePluginRegistry.self_editable_user_custom_fields)
fields.push(*DiscoursePluginRegistry.staff_editable_user_custom_fields) if by_staff
fields.uniq
end
@ -297,18 +297,18 @@ class User < ActiveRecord::Base
def self.allowed_user_custom_fields(guardian)
fields = []
fields.push *DiscoursePluginRegistry.public_user_custom_fields
fields.push(*DiscoursePluginRegistry.public_user_custom_fields)
if SiteSetting.public_user_custom_fields.present?
fields.push *SiteSetting.public_user_custom_fields.split('|')
fields.push(*SiteSetting.public_user_custom_fields.split('|'))
end
if guardian.is_staff?
if SiteSetting.staff_user_custom_fields.present?
fields.push *SiteSetting.staff_user_custom_fields.split('|')
fields.push(*SiteSetting.staff_user_custom_fields.split('|'))
end
fields.push *DiscoursePluginRegistry.staff_user_custom_fields
fields.push(*DiscoursePluginRegistry.staff_user_custom_fields)
end
fields.uniq