2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

Support for Fancy topic titles

This commit is contained in:
Robin Ward 2013-02-19 16:08:23 -05:00
parent c0371ff427
commit 836c3a7379
14 changed files with 2139 additions and 12 deletions

View file

@ -3,8 +3,20 @@ require_dependency 'age_words'
class BasicTopicSerializer < ApplicationSerializer
include ActionView::Helpers
attributes :id, :title, :reply_count, :posts_count, :highest_post_number, :image_url, :created_at,
:last_posted_at, :age, :unseen, :last_read_post_number, :unread, :new_posts
attributes :id,
:title,
:fancy_title,
:reply_count,
:posts_count,
:highest_post_number,
:image_url,
:created_at,
:last_posted_at,
:age,
:unseen,
:last_read_post_number,
:unread,
:new_posts
def age
AgeWords.age_words(Time.now - (object.created_at || Time.now))