discourse/app/serializers/group_user_with_custom_fields_serializer.rb
Jean 1d68ff430b
FEATURE: Add custom fields to members on group index (#24232)
* FEATURE: Add custom fields to members on group index
2023-11-07 10:06:47 -04:00

24 lines
513 B
Ruby

# frozen_string_literal: true
class GroupUserWithCustomFieldsSerializer < UserWithCustomFieldsSerializer
include UserPrimaryGroupMixin
attributes :name, :title, :last_posted_at, :last_seen_at, :added_at, :timezone, :status
def timezone
user.user_option.timezone
end
def include_added_at?
object.respond_to? :added_at
end
def include_status?
SiteSetting.enable_user_status && user.has_status?
end
def status
UserStatusSerializer.new(user.user_status, root: false)
end
end