discourse/app/serializers/reviewable_settings_serializer.rb
Robin Ward e74cd54fc6 REFACTOR: Replace score bonuses with low/med/high priorities
We removed score from the UX so it makes more sense to have sites set
priorities instead of score bonuses.
2019-05-23 11:54:45 -04:00

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