Class: Thredded::PostPolicy::Scope
- Inherits:
-
Object
- Object
- Thredded::PostPolicy::Scope
- Defined in:
- app/policies/thredded/post_policy.rb
Overview
The scope of readable posts. MessageboardPolicy must be applied separately.
Instance Method Summary collapse
-
#initialize(user, scope) ⇒ Scope
constructor
A new instance of Scope.
- #resolve ⇒ ActiveRecord::Relation<Thredded::Post>
Constructor Details
#initialize(user, scope) ⇒ Scope
Returns a new instance of Scope.
10 11 12 13 |
# File 'app/policies/thredded/post_policy.rb', line 10 def initialize(user, scope) @user = user @scope = scope end |
Instance Method Details
#resolve ⇒ ActiveRecord::Relation<Thredded::Post>
16 17 18 |
# File 'app/policies/thredded/post_policy.rb', line 16 def resolve @scope.moderation_state_visible_to_user(@user) end |