Class: Proclaim::PostPolicy
Defined Under Namespace
Classes: Scope
Instance Attribute Summary
#record, #user
Instance Method Summary
collapse
#edit?, #initialize, #new?, #scope
Instance Method Details
#create? ⇒ Boolean
15
16
17
|
# File 'app/policies/proclaim/post_policy.rb', line 15
def create?
not @user.nil? end
|
#destroy? ⇒ Boolean
23
24
25
|
# File 'app/policies/proclaim/post_policy.rb', line 23
def destroy?
not @user.nil? end
|
#index? ⇒ Boolean
3
4
5
|
# File 'app/policies/proclaim/post_policy.rb', line 3
def index?
true end
|
#show? ⇒ Boolean
7
8
9
10
11
12
13
|
# File 'app/policies/proclaim/post_policy.rb', line 7
def show?
if @user
true else
@record.published? end
end
|
#update? ⇒ Boolean
19
20
21
|
# File 'app/policies/proclaim/post_policy.rb', line 19
def update?
not @user.nil? end
|