From fab59c66f0eff49fdadd7a50b64a7e4a7ae43970 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 4 Jun 2018 15:43:26 -0400 Subject: [PATCH] FIX: Protection against dangling category group records --- app/models/category.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/category.rb b/app/models/category.rb index 4d042500afd..379cc5acc7c 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -310,7 +310,9 @@ SQL def permissions_params hash = {} category_groups.includes(:group).each do |category_group| - hash[category_group.group_name] = category_group.permission_type + if category_group.group.present? + hash[category_group.group_name] = category_group.permission_type + end end hash end