mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
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:
parent
74b661317c
commit
c4cce68613
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue