2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-04-02 16:00:15 -05:00
|
|
|
class ReviewableSettingsSerializer < ApplicationSerializer
|
2019-05-22 16:23:45 -05:00
|
|
|
attributes :id, :reviewable_priorities
|
2019-04-02 16:00:15 -05:00
|
|
|
|
|
|
|
has_many :reviewable_score_types, serializer: ReviewableScoreTypeSerializer
|
|
|
|
|
|
|
|
def id
|
|
|
|
scope.user.id
|
|
|
|
end
|
|
|
|
|
|
|
|
def reviewable_score_types
|
|
|
|
object[:reviewable_score_types]
|
|
|
|
end
|
2019-05-22 16:23:45 -05:00
|
|
|
|
|
|
|
def reviewable_priorities
|
|
|
|
Reviewable.priorities.map do |p|
|
|
|
|
{ id: p[1], name: I18n.t("reviewables.priorities.#{p[0]}") }
|
|
|
|
end
|
|
|
|
end
|
2019-04-02 16:00:15 -05:00
|
|
|
end
|