summaryrefslogtreecommitdiff
path: root/lib/chef/guard_interpreter
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/guard_interpreter')
-rw-r--r--lib/chef/guard_interpreter/resource_guard_interpreter.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/guard_interpreter/resource_guard_interpreter.rb b/lib/chef/guard_interpreter/resource_guard_interpreter.rb
index 946ee2ba49..0a88d75d5c 100644
--- a/lib/chef/guard_interpreter/resource_guard_interpreter.rb
+++ b/lib/chef/guard_interpreter/resource_guard_interpreter.rb
@@ -92,11 +92,11 @@ class Chef
def merge_inherited_attributes
inherited_attributes = []
- if @parent_resource.respond_to?(:guard_inherited_attributes)
- inherited_attributes = @parent_resource.send(:guard_inherited_attributes)
+ if @parent_resource.class.respond_to?(:guard_inherited_attributes)
+ inherited_attributes = @parent_resource.class.send(:guard_inherited_attributes)
end
-
- if inherited_attributes
+
+ if inherited_attributes && !inherited_attributes.empty?
inherited_attributes.each do |attribute|
if @parent_resource.respond_to?(attribute) && @resource.respond_to?(attribute)
parent_value = @parent_resource.send(attribute)