Sha256: b17611da786e571225cb23a85635f26e9d8bdae678582ecc6c0dac4fcb062452
Contents?: true
Size: 613 Bytes
Versions: 1
Compression:
Stored size: 613 Bytes
Contents
class ApplicationPolicy attr_reader :user, :record def initialize(user, record) @user = user @record = record end def index? false end def show? scope.where(:id => record.id).exists? end def create? false end def new? create? end def update? false end def edit? update? end def destroy? false end def scope Pundit.policy_scope!(user, record.class) end class Scope attr_reader :user, :scope def initialize(user, scope) @user = user @scope = scope end def resolve scope end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pundit-0.3.0 | lib/generators/pundit/install/templates/application_policy.rb |