2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-04-02 17:00:15 -04:00
|
|
|
class ReviewableSettingsSerializer < ApplicationSerializer
|
2019-05-22 17:23:45 -04:00
|
|
|
attributes :id, :reviewable_priorities
|
2019-04-02 17:00:15 -04: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 17:23:45 -04:00
|
|
|
|
|
|
|
def reviewable_priorities
|
|
|
|
Reviewable.priorities.map do |p|
|
|
|
|
{ id: p[1], name: I18n.t("reviewables.priorities.#{p[0]}") }
|
|
|
|
end
|
|
|
|
end
|
2019-04-02 17:00:15 -04:00
|
|
|
end
|