FEATURE: make pin expiration mandatory

This commit is contained in:
Régis Hanol
2015-07-29 16:34:21 +02:00
parent 9e2632badd
commit faf4f44776
18 changed files with 192 additions and 97 deletions

View File

@@ -43,6 +43,7 @@ class TopicViewSerializer < ApplicationSerializer
:pinned_globally,
:pinned, # Is topic pinned and viewer hasn't cleared the pin?
:pinned_at, # Ignores clear pin
:pinned_until,
:details,
:highest_post_number,
:last_read_post_number,
@@ -177,6 +178,10 @@ class TopicViewSerializer < ApplicationSerializer
object.topic.pinned_at
end
def pinned_until
object.topic.pinned_until
end
def actions_summary
result = []
return [] unless post = object.posts.try(:first)