Class: PagePolicy

Inherits:
BlockRecordPolicy show all
Defined in:
app/policies/page_policy.rb

Instance Attribute Summary

Attributes inherited from ApplicationPolicy

#record, #user

Instance Method Summary collapse

Methods inherited from BlockRecordPolicy

#index?

Methods inherited from ApplicationPolicy

#create?, #destroy?, #edit?, #index?, #initialize, #new?, #scope, #update?, #view_hidden?

Constructor Details

This class inherits a constructor from ApplicationPolicy

Instance Method Details

#show?Boolean

Returns:

  • (Boolean)


2
3
4
5
6
7
8
# File 'app/policies/page_policy.rb', line 2

def show?
  if @record.statusable?
    @record.published? || view_hidden?
  else
    true
  end
end