2013-02-05 14:16:51 -05:00
|
|
|
class SuggestedTopicSerializer < BasicTopicSerializer
|
|
|
|
|
|
|
|
attributes :archetype, :slug, :like_count, :views, :last_post_age
|
|
|
|
has_one :category, embed: :objects
|
|
|
|
|
|
|
|
def last_post_age
|
|
|
|
return nil if object.last_posted_at.blank?
|
|
|
|
AgeWords.age_words(Time.now - object.last_posted_at)
|
|
|
|
end
|
2013-02-07 10:45:24 -05:00
|
|
|
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|