Class: TopicPolicy
Instance Attribute Summary
#record, #user
Instance Method Summary
collapse
#destroy_all?, #index?, #initialize, #scope, #show?
Instance Method Details
#create? ⇒ Boolean
7
8
9
|
# File 'app/policies/topic_policy.rb', line 7
def create?
true
end
|
#destroy? ⇒ Boolean
15
16
17
|
# File 'app/policies/topic_policy.rb', line 15
def destroy?
update?
end
|
#edit? ⇒ Boolean
11
12
13
|
# File 'app/policies/topic_policy.rb', line 11
def edit?
update?
end
|
#new? ⇒ Boolean
3
4
5
|
# File 'app/policies/topic_policy.rb', line 3
def new?
create?
end
|
#update? ⇒ Boolean
19
20
21
|
# File 'app/policies/topic_policy.rb', line 19
def update?
record.editable_by?(user)
end
|