Sha256: 98ced17e23ef7a461a9a50fe4e2ba0f77e95e2bfaead767d1596df493fabbdd7
Contents?: true
Size: 929 Bytes
Versions: 11
Compression:
Stored size: 929 Bytes
Contents
# frozen_string_literal: true module Thredded module UserPermissions module Moderate module IfModeratorColumnTrue extend ActiveSupport::Concern included { extend ClassMethods } # @return [ActiveRecord::Relation<Thredded::Messageboard>] messageboards that the user can moderate def thredded_can_moderate_messageboards send(Thredded.moderator_column) ? Thredded::Messageboard.all : Thredded::Messageboard.none end module ClassMethods # Users that can moderate the given messageboards. # # @param _messageboards [Array<Thredded::Messageboard>] # @return [ActiveRecord::Relation<Thredded.user_class>] users that can moderate the given messageboards def thredded_messageboards_moderators(_messageboards) where(Thredded.moderator_column => true) end end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems