FEATURE: Whisper posts

This commit is contained in:
Robin Ward
2015-09-10 16:01:23 -04:00
parent 62cc029886
commit 5af0f5f80e
19 changed files with 186 additions and 29 deletions

View File

@ -218,6 +218,13 @@ class Topic < ActiveRecord::Base
end
end
def visible_post_types(viewed_by=nil)
types = Post.types
result = [types[:regular], types[:moderator_action], types[:small_action]]
result << types[:whisper] if viewed_by.try(:staff?)
result
end
def self.top_viewed(max = 10)
Topic.listable_topics.visible.secured.order('views desc').limit(max)
end