Class: Thredded::TopicPostsPageView

Inherits:
PostsPageView show all
Defined in:
app/view_models/thredded/topic_posts_page_view.rb

Overview

A view model for a page of PostViews of a Topic.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, topic, paginated_scope) ⇒ TopicPostsPageView

Returns a new instance of TopicPostsPageView.

Parameters:



12
13
14
15
# File 'app/view_models/thredded/topic_posts_page_view.rb', line 12

def initialize(user, topic, paginated_scope)
  @topic = "#{paginated_scope.reflect_on_association(:postable).klass}View".constantize.from_user(topic, user)
  super(user, paginated_scope, topic_view: @topic)
end

Instance Attribute Details

#topicThredded::BaseTopicView (readonly)



7
8
9
# File 'app/view_models/thredded/topic_posts_page_view.rb', line 7

def topic
  @topic
end