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