Add Post#is_first_post?

We should be able to ask a post if it's the first in a topic
This commit is contained in:
Chris Hunt 2013-05-25 17:18:04 -07:00
parent 74b661317c
commit c4cce68613
1 changed files with 4 additions and 0 deletions

View File

@ -317,6 +317,10 @@ class Post < ActiveRecord::Base
result
end
def is_first_post?
post_number == 1
end
def is_flagged?
post_actions.where(post_action_type_id: PostActionType.flag_types.values, deleted_at: nil).count != 0
end