Sha256: 76d273e8bc40236fd1e7b3f1b197e2cfea398ebe90c0c5715de962f2935b4027
Contents?: true
Size: 474 Bytes
Versions: 47
Compression:
Stored size: 474 Bytes
Contents
class ApplicationPolicy attr_reader :user, :record def initialize(user, record) @user = user @record = record end def index? true end def show? scope.where(:id => record.id).exists? end def new? create? end def create? true end def edit? update? end def update? true end def destroy? true end def destroy_all? true end def scope Pundit.policy_scope!(user, record.class) end end
Version data entries
47 entries across 47 versions & 8 rubygems