diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-11-20 11:48:54 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-11-21 15:03:03 -0800 |
commit | 097d5eb1bf4b3cbcc9bfc937c5e3441dee5c9f5c (patch) | |
tree | fea7dad94efca60b209fd800148bfde053f0503d /lib/chef/node/attribute_collections.rb | |
parent | 5427540f7f9a919d3032fb8b7c321b52bd0f3e3b (diff) | |
download | chef-097d5eb1bf4b3cbcc9bfc937c5e3441dee5c9f5c.tar.gz |
add partial deep merge cache
Diffstat (limited to 'lib/chef/node/attribute_collections.rb')
-rw-r--r-- | lib/chef/node/attribute_collections.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/node/attribute_collections.rb b/lib/chef/node/attribute_collections.rb index 3b19a14d1c..333f4864c6 100644 --- a/lib/chef/node/attribute_collections.rb +++ b/lib/chef/node/attribute_collections.rb @@ -63,6 +63,7 @@ class Chef MUTATOR_METHODS.each do |mutator| class_eval(<<-METHOD_DEFN, __FILE__, __LINE__) def #{mutator}(*args, &block) + root.reset_cache(root.top_level_breadcrumb) super end METHOD_DEFN @@ -127,6 +128,7 @@ class Chef MUTATOR_METHODS.each do |mutator| class_eval(<<-METHOD_DEFN, __FILE__, __LINE__) def #{mutator}(*args, &block) + root.reset_cache(root.top_level_breadcrumb) super end METHOD_DEFN @@ -138,6 +140,7 @@ class Chef end def [](key) + root.top_level_breadcrumb ||= key value = super if !key?(key) value = self.class.new(root) @@ -148,9 +151,11 @@ class Chef end def []=(key, value) + root.top_level_breadcrumb ||= key if set_unless? && key?(key) self[key] else + root.reset_cache(root.top_level_breadcrumb) super end end |