FEATURE: Can create warnings for users via PM

This commit is contained in:
Robin Ward
2014-09-05 15:40:25 -04:00
parent a8e4c4caa1
commit b0bfc1f93f
37 changed files with 243 additions and 18 deletions

View File

@ -41,7 +41,9 @@ class TopicViewSerializer < ApplicationSerializer
:deleted_by,
:has_deleted,
:actions_summary,
:expandable_first_post
:expandable_first_post,
:is_warning
# Define a delegator for each attribute of the topic we want
attributes(*topic_attributes)
@ -109,6 +111,14 @@ class TopicViewSerializer < ApplicationSerializer
result
end
def is_warning
object.topic.private_message? && object.topic.warning.present?
end
def include_is_warning?
is_warning
end
def draft
object.draft
end