Sha256: fe17f8131a28fb41109c8ecade9a01b65b58f055dcce54ca34d18c3dfd985b59

Contents?: true

Size: 327 Bytes

Versions: 1

Compression:

Stored size: 327 Bytes

Contents

module Raddar
  class NotificationPolicy < ApplicationPolicy
    class Scope < Struct.new(:user, :scope)
      def resolve
        scope
      end
    end

    def index?
      @user.present?
    end

    def show?
      @user.present? && @record.user == @user
    end

    def read_all?
      @user.present?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
raddar-0.0.1.pre app/policies/raddar/notification_policy.rb