Class: BlockRecordPolicy

Inherits:
ApplicationPolicy show all
Defined in:
app/policies/block_record_policy.rb

Instance Attribute Summary

Attributes inherited from ApplicationPolicy

#record, #user

Instance Method Summary collapse

Methods inherited from ApplicationPolicy

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

Constructor Details

This class inherits a constructor from ApplicationPolicy

Instance Method Details

#index?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'app/policies/block_record_policy.rb', line 10

def index?
  true
end

#show?Boolean

Returns:

  • (Boolean)


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

def show?
  if record.respond_to?(:statusable?)
    record.published? || edit?
  else
    true
  end
end