- def post_action_types
- cache_fragment("post_action_types") do
- ActiveModel::ArraySerializer.new(PostActionType.ordered).as_json
- end
- end
- def topic_flag_types
- cache_fragment("post_action_flag_types") do
- flags = PostActionType.ordered.where(name_key: ['inappropriate', 'spam', 'notify_moderators'])
- ActiveModel::ArraySerializer.new(flags, each_serializer: TopicFlagTypeSerializer).as_json
- end
- end