Sha256: 9003e1baa059fe0f28ccc01f3b1cfb2156f20520e005f10be13882c498c4b812
Contents?: true
Size: 392 Bytes
Versions: 24
Compression:
Stored size: 392 Bytes
Contents
module Proclaim class CommentPolicy < ApplicationPolicy def create? # Users can comment on whatever they want, but guests can only comment # on published posts if @user true else @record.post.published? end end def update? not @user.nil? end def destroy? not @user.nil? end class Scope < Scope def resolve scope.all end end end end
Version data entries
24 entries across 24 versions & 1 rubygems