if mappable is nil it causes an error

This commit is contained in:
Devin Howard 2016-07-02 09:44:32 +08:00
parent d1792d4fd7
commit 39562aad7e

View file

@ -16,7 +16,7 @@ class MappingPolicy < ApplicationPolicy
end end
def show? def show?
map_policy.show? && mappable_policy.show? map_policy.show? && mappable_policy.try(:show?)
end end
def create? def create?