null check in synapse policy
This commit is contained in:
parent
f1ecc9eb0b
commit
97448b389f
1 changed files with 4 additions and 4 deletions
|
@ -48,13 +48,13 @@ class SynapsePolicy < ApplicationPolicy
|
|||
end
|
||||
|
||||
def topic1_show?
|
||||
@topic1_policy ||= Pundit.policy(user, record.topic1)
|
||||
@topic1_policy&.show?
|
||||
@topic1_policy ||= Pundit.policy(user, record&.topic1)
|
||||
@topic1_policy&.show? != false
|
||||
end
|
||||
|
||||
def topic2_show?
|
||||
@topic2_policy ||= Pundit.policy(user, record.topic2)
|
||||
@topic2_policy&.show?
|
||||
@topic2_policy ||= Pundit.policy(user, record&.topic2)
|
||||
@topic2_policy&.show? != false
|
||||
end
|
||||
|
||||
def synapse_show?
|
||||
|
|
Loading…
Reference in a new issue