Class: ReviewableScoreTypeSerializer
Instance Method Summary
collapse
expire_cache_fragment!, fragment_cache
#include!
Instance Method Details
#icon ⇒ Object
24
25
26
|
# File 'app/serializers/reviewable_score_type_serializer.rb', line 24
def icon
"flag"
end
|
#include_reviewable_priority? ⇒ Boolean
20
21
22
|
# File 'app/serializers/reviewable_score_type_serializer.rb', line 20
def include_reviewable_priority?
object.respond_to?(:reviewable_priority)
end
|
#reviewable_priority ⇒ Object
16
17
18
|
# File 'app/serializers/reviewable_score_type_serializer.rb', line 16
def reviewable_priority
object.reviewable_priority.to_i
end
|
#title ⇒ Object
Allow us to share post action type translations for backwards compatibility
11
12
13
14
|
# File 'app/serializers/reviewable_score_type_serializer.rb', line 11
def title
I18n.t("post_action_types.#{ReviewableScore.types[id]}.title", default: nil) ||
I18n.t("reviewable_score_types.#{ReviewableScore.types[id]}.title")
end
|
#type ⇒ Object
6
7
8
|
# File 'app/serializers/reviewable_score_type_serializer.rb', line 6
def type
ReviewableScore.types[id]
end
|