DEV: Remove TopicView#first_post_id. (#14631)

The method was only used for mega topics but it was redundant as the
first post can be determined from using the condition where
`Post#post_number` equal to one.
This commit is contained in:
Alan Guo Xiang Tan
2021-10-18 14:47:47 +08:00
committed by GitHub
parent b69c2f7311
commit fb5a062b1f
5 changed files with 5 additions and 30 deletions

View File

@@ -631,10 +631,6 @@ class TopicView
@is_mega_topic ||= (@topic.posts_count >= MEGA_TOPIC_POSTS_COUNT)
end
def first_post_id
@filtered_posts.order(sort_order: :asc).pluck_first(:id)
end
def last_post_id
@filtered_posts.order(sort_order: :desc).pluck_first(:id)
end