Module: Thredded::UserPermissions::Moderate::IfModeratorColumnTrue
- Extended by:
- ActiveSupport::Concern
- Included in:
- Thredded::UserExtender
- Defined in:
- app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb
Instance Method Summary collapse
-
#thredded_can_moderate_messageboard?(messageboard) ⇒ Boolean
Whether the user can moderate the given messageboard.
-
#thredded_can_moderate_messageboards ⇒ ActiveRecord::Relation<Thredded::Messageboard>
Messageboards that the user can moderate.
Instance Method Details
#thredded_can_moderate_messageboard?(messageboard) ⇒ Boolean
Returns Whether the user can moderate the given messageboard.
16 17 18 19 |
# File 'app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb', line 16 def () scope = scope == Thredded::Messageboard.all || scope.include?() end |
#thredded_can_moderate_messageboards ⇒ ActiveRecord::Relation<Thredded::Messageboard>
Returns messageboards that the user can moderate.
10 11 12 |
# File 'app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb', line 10 def send(Thredded.moderator_column) ? Thredded::Messageboard.all : Thredded::Messageboard.none end |