mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
We never want to filter TopicView to just one post.
This commit is contained in:
@@ -3,7 +3,7 @@ require_dependency 'topic_query'
|
||||
|
||||
class TopicView
|
||||
|
||||
attr_accessor :topic, :min, :max, :draft, :draft_key, :draft_sequence
|
||||
attr_accessor :topic, :min, :max, :draft, :draft_key, :draft_sequence, :posts
|
||||
|
||||
def initialize(topic_id, user=nil, options={})
|
||||
@topic = find_topic(topic_id)
|
||||
@@ -127,15 +127,6 @@ class TopicView
|
||||
@max = @min + @posts.size
|
||||
end
|
||||
|
||||
def posts
|
||||
@post_number.present? ? find_post_by_post_number : @posts
|
||||
end
|
||||
|
||||
def find_post_by_post_number
|
||||
@posts.select {|post| post.post_number == @post_number.to_i }
|
||||
end
|
||||
|
||||
|
||||
def read?(post_number)
|
||||
read_posts_set.include?(post_number)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user