Sha256: 7bf9ea6f720ba79ef926f3892364b041279ed6aa6026bd453409077479f409d9

Contents?: true

Size: 463 Bytes

Versions: 11

Compression:

Stored size: 463 Bytes

Contents

# frozen_string_literal: true

module Thredded
  module UserPermissions
    module Moderate
      module IfModeratorColumnTrue
        extend ActiveSupport::Concern

        # @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
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
thredded-0.15.4 app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb
thredded-0.15.3 app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb
thredded-0.15.2 app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb
thredded-0.15.1 app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb
threddedDANIEL-0.14.5 app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb
thredded-0.14.4 app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb
thredded-0.14.3 app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb
thredded-0.14.2 app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb
thredded-0.14.1 app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb
thredded-0.14.0 app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb
thredded-0.13.8 app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb