Sha256: 1bdc2a08cff93fb1ccc394e1d522f19ff2cdb6b2109443de4d57fd7965b1fd41
Contents?: true
Size: 609 Bytes
Versions: 28
Compression:
Stored size: 609 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 new? create? end def create? false end def edit? update? end def update? false 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
28 entries across 28 versions & 1 rubygems