Sha256: 26105b89a0e6d2383f0d5c2432a35ca8e02b2addec5aaa97232d4055814741ef
Contents?: true
Size: 471 Bytes
Versions: 2
Compression:
Stored size: 471 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
activeadmin-1.0.0 | spec/support/templates/policies/application_policy.rb |
activeadmin-1.0.0.pre5 | spec/support/templates/policies/application_policy.rb |