mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 08:46:19 +08:00
e74cd54fc6
We removed score from the UX so it makes more sense to have sites set priorities instead of score bonuses.
22 lines
467 B
Ruby
22 lines
467 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ReviewableSettingsSerializer < ApplicationSerializer
|
|
attributes :id, :reviewable_priorities
|
|
|
|
has_many :reviewable_score_types, serializer: ReviewableScoreTypeSerializer
|
|
|
|
def id
|
|
scope.user.id
|
|
end
|
|
|
|
def reviewable_score_types
|
|
object[:reviewable_score_types]
|
|
end
|
|
|
|
def reviewable_priorities
|
|
Reviewable.priorities.map do |p|
|
|
{ id: p[1], name: I18n.t("reviewables.priorities.#{p[0]}") }
|
|
end
|
|
end
|
|
end
|