From 602b8f898cb83d72823da0c19fc496bc719bb73a Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Sun, 8 Apr 2018 22:23:28 +0200 Subject: Fix test when control_attributes or keys not exist Refs #6177 @1 --- app/helpers/compliance_controls_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/compliance_controls_helper.rb b/app/helpers/compliance_controls_helper.rb index 297ae3afa..abf909929 100644 --- a/app/helpers/compliance_controls_helper.rb +++ b/app/helpers/compliance_controls_helper.rb @@ -11,7 +11,7 @@ module ComplianceControlsHelper def compliance_control_metadatas(compliance_control) attributes = resource.class.dynamic_attributes - attributes.push(*resource.control_attributes.keys) if resource.respond_to? :control_attributes + attributes.push(*resource.control_attributes.keys) if resource&.control_attributes&.keys {}.tap do |hash| attributes.each do |attribute| @@ -19,4 +19,4 @@ module ComplianceControlsHelper end end end -end +end -- cgit v1.2.3