Class: TopicEmbedSerializer

Inherits:
ApplicationSerializer show all
Defined in:
app/serializers/topic_embed_serializer.rb

Instance Method Summary collapse

Methods inherited from ApplicationSerializer

expire_cache_fragment!, fragment_cache

Methods inherited from ActiveModel::Serializer

#include!

Instance Method Details

#comment_countObject



10
11
12
# File 'app/serializers/topic_embed_serializer.rb', line 10

def comment_count
  object.topic.posts_count - 1
end

#topic_slugObject



6
7
8
# File 'app/serializers/topic_embed_serializer.rb', line 6

def topic_slug
  object.topic.slug
end