Class: Thredded::TopicPostsPageView
- Inherits:
-
PostsPageView
- Object
- PostsPageView
- Thredded::TopicPostsPageView
- 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
- #topic ⇒ Thredded::BaseTopicView readonly
Instance Method Summary collapse
-
#initialize(user, topic, paginated_scope) ⇒ TopicPostsPageView
constructor
A new instance of TopicPostsPageView.
Constructor Details
#initialize(user, topic, paginated_scope) ⇒ TopicPostsPageView
Returns a new instance of TopicPostsPageView.
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
#topic ⇒ Thredded::BaseTopicView (readonly)
7 8 9 |
# File 'app/view_models/thredded/topic_posts_page_view.rb', line 7 def topic @topic end |