docbrown/app/serializers/search/user_serializer.rb
Jan Klimo a6ea2c9618
Migrate serialization to jsonapi-serializer (#9682)
This replaces the abandoned fast_jsonapi.
2020-08-08 15:41:44 +02:00

22 lines
570 B
Ruby

module Search
class UserSerializer < ApplicationSerializer
attributes :id,
:available_for,
:comments_count,
:badge_achievements_count,
:employer_name,
:hotness_score,
:last_comment_at,
:mostly_work_with,
:name,
:path,
:public_reactions_count,
:profile_image_90,
:reactions_count,
:username
attribute :roles do |user|
user.roles.map(&:name)
end
end
end