mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 04:03:57 -06: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
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user