Sha256: 366da4c736cbbd4222a44b542778c470dc249e2bc214ed131a26286b7d735959

Contents?: true

Size: 520 Bytes

Versions: 11

Compression:

Stored size: 520 Bytes

Contents

class ApplicationPolicy
  attr_reader :user, :record

  def initialize(user, record)
    @user = user
    @record = record
  end

  def index?
    false
  end

  def show?
    false
  end

  def create?
    false
  end

  def new?
    create?
  end

  def update?
    false
  end

  def edit?
    update?
  end

  def destroy?
    false
  end

  class Scope
    attr_reader :user, :scope

    def initialize(user, scope)
      @user = user
      @scope = scope
    end

    def resolve
      scope.all
    end
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
kono_utils-1.1.4 spec/dummy/app/policies/application_policy.rb
kono_utils-1.1.3 spec/dummy/app/policies/application_policy.rb
kono_utils-1.1.2 spec/dummy/app/policies/application_policy.rb
kono_utils-1.1.1 spec/dummy/app/policies/application_policy.rb
kono_utils-1.1.0 spec/dummy/app/policies/application_policy.rb
rapils-0.1.0.pre.alpha2 lib/rapils/policies/application_policy.rb
rapils-0.1.0.pre.alpha1 lib/rapils/policies/application_policy.rb
pundit-2.1.0 lib/generators/pundit/install/templates/application_policy.rb
pundit-2.0.1 lib/generators/pundit/install/templates/application_policy.rb
pundit-2.0.0 lib/generators/pundit/install/templates/application_policy.rb
pundit-2.0.0.beta1 lib/generators/pundit/install/templates/application_policy.rb