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

View file

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