Sha256: f9d2584b49c1916afafb190f0e3c1b9512b59ffa2e4337aafc0ad4278ff2db8c
Contents?: true
Size: 609 Bytes
Versions: 34
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 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
34 entries across 33 versions & 2 rubygems