Class: PostActionTypeSerializer

Inherits:
ApplicationSerializer show all
Includes:
ConfigurableUrls
Defined in:
app/serializers/post_action_type_serializer.rb

Direct Known Subclasses

TopicFlagTypeSerializer

Instance Method Summary collapse

Methods included from ConfigurableUrls

#faq_path, #privacy_policy_url, #tos_url

Methods inherited from ApplicationSerializer

expire_cache_fragment!, fragment_cache

Methods inherited from ActiveModel::Serializer

#include!

Instance Method Details

#descriptionObject



20
21
22
# File 'app/serializers/post_action_type_serializer.rb', line 20

def description
  i18n("description", tos_url: tos_url, base_path: Discourse.base_path)
end

#is_custom_flagObject



8
9
10
# File 'app/serializers/post_action_type_serializer.rb', line 8

def is_custom_flag
  !!PostActionType.custom_types[object.id]
end

#is_flagObject



12
13
14
# File 'app/serializers/post_action_type_serializer.rb', line 12

def is_flag
  !!PostActionType.flag_types[object.id]
end

#nameObject



16
17
18
# File 'app/serializers/post_action_type_serializer.rb', line 16

def name
  i18n("title")
end

#name_keyObject



28
29
30
# File 'app/serializers/post_action_type_serializer.rb', line 28

def name_key
  PostActionType.types[object.id]
end

#short_descriptionObject



24
25
26
# File 'app/serializers/post_action_type_serializer.rb', line 24

def short_description
  i18n("short_description", tos_url: tos_url, base_path: Discourse.base_path)
end