From a05c7dc5fe497ae1f5df2ed860bfdb3ad686b6ea Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Mon, 14 Mar 2016 14:37:01 +0800 Subject: [PATCH] avoid pundit error if no map specified with a mapping --- app/policies/mapping_policy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/policies/mapping_policy.rb b/app/policies/mapping_policy.rb index 40b71f61..5826ccd4 100644 --- a/app/policies/mapping_policy.rb +++ b/app/policies/mapping_policy.rb @@ -20,7 +20,7 @@ class MappingPolicy < ApplicationPolicy end def create? - map_policy.update? + record.map.present? && map_policy.update? end def update?