discourse/app/serializers/reviewable_topic_serializer.rb
Robin Ward b380ed5282 FEATURE: Claim Reviewables by Topic
This is a feature that used to be present in discourse-assign but is
much easier to implement in core. It also allows a topic to be assigned
without it claiming for review and vice versa and allows it to work with
category group reviewers.
2019-05-09 13:40:36 -04:00

31 lines
490 B
Ruby

class ReviewableTopicSerializer < ApplicationSerializer
attributes(
:id,
:title,
:fancy_title,
:slug,
:archived,
:closed,
:visible,
:archetype,
:relative_url,
:stats,
:reviewable_score
)
has_one :claimed_by, serializer: BasicUserSerializer, root: 'users'
def stats
@options[:stats][object.id]
end
def claimed_by
@options[:claimed_topics][object.id]
end
def include_claimed_by?
@options[:claimed_topics]
end
end