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