mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
This reverts commit 746f8f3797
.
This commit is contained in:
parent
746f8f3797
commit
581d435d09
3 changed files with 3 additions and 6 deletions
|
@ -53,7 +53,7 @@ class ReviewableScore < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def score_type
|
def score_type
|
||||||
Reviewable::Collection::Item.new(reviewable_score_type, reason: reason)
|
Reviewable::Collection::Item.new(reviewable_score_type)
|
||||||
end
|
end
|
||||||
|
|
||||||
def took_action?
|
def took_action?
|
||||||
|
|
|
@ -5,8 +5,6 @@ class ReviewableScoreTypeSerializer < ApplicationSerializer
|
||||||
|
|
||||||
# Allow us to share post action type translations for backwards compatibility
|
# Allow us to share post action type translations for backwards compatibility
|
||||||
def title
|
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("post_action_types.#{ReviewableScore.types[id]}.title", default: nil) ||
|
||||||
I18n.t("reviewable_score_types.#{ReviewableScore.types[id]}.title")
|
I18n.t("reviewable_score_types.#{ReviewableScore.types[id]}.title")
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,11 +4,10 @@ class Reviewable < ActiveRecord::Base
|
||||||
class Collection
|
class Collection
|
||||||
class Item
|
class Item
|
||||||
include ActiveModel::Serialization
|
include ActiveModel::Serialization
|
||||||
attr_reader :id, :reason
|
attr_reader :id
|
||||||
|
|
||||||
def initialize(id, reason: nil)
|
def initialize(id)
|
||||||
@id = id
|
@id = id
|
||||||
@reason = reason
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue