We never want to filter TopicView to just one post.

This commit is contained in:
Robin Ward
2013-02-12 19:02:16 -05:00
parent 69c7b5aeed
commit 27a07054d7
2 changed files with 16 additions and 30 deletions

View File

@@ -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