fix policy(Synapse).create?
This commit is contained in:
parent
053da92dde
commit
42d3850f2e
1 changed files with 6 additions and 1 deletions
|
@ -16,7 +16,12 @@ class SynapsePolicy < ApplicationPolicy
|
||||||
end
|
end
|
||||||
|
|
||||||
def create?
|
def create?
|
||||||
topic1_show? && topic2_show? && user.present?
|
if record.try(:topic1) && record.try(:topic2)
|
||||||
|
topic1_show? && topic2_show? && user.present?
|
||||||
|
else
|
||||||
|
# allows us to use policy(Synapse).create?
|
||||||
|
user.present?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def show?
|
def show?
|
||||||
|
|
Loading…
Add table
Reference in a new issue