From 581d435d09ad18528b5c347e3037c88a30faccc1 Mon Sep 17 00:00:00 2001 From: Roman Rizzi Date: Mon, 21 Mar 2022 16:32:47 -0300 Subject: [PATCH] Revert "FEATURE: Let reviewables override the score type title. (#16234)" (#16238) This reverts commit 746f8f37973eb775fbcb1d938d0438b019e6cee9. --- app/models/reviewable_score.rb | 2 +- app/serializers/reviewable_score_type_serializer.rb | 2 -- lib/reviewable/collection.rb | 5 ++--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/models/reviewable_score.rb b/app/models/reviewable_score.rb index 2cc5cb63bd5..34080a944d9 100644 --- a/app/models/reviewable_score.rb +++ b/app/models/reviewable_score.rb @@ -53,7 +53,7 @@ class ReviewableScore < ActiveRecord::Base end def score_type - Reviewable::Collection::Item.new(reviewable_score_type, reason: reason) + Reviewable::Collection::Item.new(reviewable_score_type) end def took_action? diff --git a/app/serializers/reviewable_score_type_serializer.rb b/app/serializers/reviewable_score_type_serializer.rb index a5f32e38111..60368ebcbce 100644 --- a/app/serializers/reviewable_score_type_serializer.rb +++ b/app/serializers/reviewable_score_type_serializer.rb @@ -5,8 +5,6 @@ class ReviewableScoreTypeSerializer < ApplicationSerializer # Allow us to share post action type translations for backwards compatibility def title - # Calling #try here because post action types don't have a reason method. - I18n.t("reviewables.reason_titles.#{object.try(:reason)}", default: nil) || I18n.t("post_action_types.#{ReviewableScore.types[id]}.title", default: nil) || I18n.t("reviewable_score_types.#{ReviewableScore.types[id]}.title") end diff --git a/lib/reviewable/collection.rb b/lib/reviewable/collection.rb index 449877a1667..1a9b354fbc5 100644 --- a/lib/reviewable/collection.rb +++ b/lib/reviewable/collection.rb @@ -4,11 +4,10 @@ class Reviewable < ActiveRecord::Base class Collection class Item include ActiveModel::Serialization - attr_reader :id, :reason + attr_reader :id - def initialize(id, reason: nil) + def initialize(id) @id = id - @reason = reason end end