discourse/app/serializers/reviewable_score_explanation_serializer.rb
Robin Ward bde0ef865f
FEATURE: Adds a pop up that shows a more detailed score for reviewables (#8035)
If you click a (?) icon beside the reviewable status a pop up will
appear with expanded informatio that explains how the reviewable got its
score, and how it compares to system thresholds.
2019-09-04 09:56:25 -06:00

25 lines
467 B
Ruby

# frozen_string_literal: true
class ReviewableScoreExplanationSerializer < ApplicationSerializer
attributes(
:user_id,
:type_bonus,
:trust_level_bonus,
:take_action_bonus,
:flags_agreed,
:flags_disagreed,
:flags_ignored,
:user_accuracy_bonus,
:score
)
def user_accuracy_bonus
ReviewableScore.calc_user_accuracy_bonus(
object.flags_agreed,
object.flags_disagreed,
object.flags_ignored
)
end
end