Class: Thredded::PostsPageView
- Inherits:
-
Object
- Object
- Thredded::PostsPageView
- Defined in:
- app/view_models/thredded/posts_page_view.rb
Overview
A view model for a page of PostViews.
Instance Method Summary collapse
-
#initialize(user, paginated_scope) ⇒ PostsPageView
constructor
A new instance of PostsPageView.
Constructor Details
#initialize(user, paginated_scope) ⇒ PostsPageView
Returns a new instance of PostsPageView.
21 22 23 24 25 26 |
# File 'app/view_models/thredded/posts_page_view.rb', line 21 def initialize(user, paginated_scope) @posts_paginator = paginated_scope @post_views = paginated_scope.map do |post| Thredded::PostView.new(post, Pundit.policy!(user, post)) end end |