summaryrefslogtreecommitdiff
path: root/lib/chef/data_bag_item.rb
diff options
context:
space:
mode:
authorJosh Hudson <jhudson@chef.io>2016-02-26 14:20:19 -0700
committerJosh Hudson <jhudson@chef.io>2016-02-26 14:20:19 -0700
commit6aa6c8945828deb50b2143ddf46f70697b9076fd (patch)
tree710ac573c7c9def92bb95c2433987ae7bcac2ecf /lib/chef/data_bag_item.rb
parent5f72ac57337bd4914d87a48bdfb49c2d1d039951 (diff)
downloadchef-6aa6c8945828deb50b2143ddf46f70697b9076fd.tar.gz
Fix a bug that was causing DataBagItem.to_hash to mutate the data bag itemjjh/databag_item_to_hash_non_mutating
Diffstat (limited to 'lib/chef/data_bag_item.rb')
-rw-r--r--lib/chef/data_bag_item.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/data_bag_item.rb b/lib/chef/data_bag_item.rb
index 0e3fa48e68..6ac863a47d 100644
--- a/lib/chef/data_bag_item.rb
+++ b/lib/chef/data_bag_item.rb
@@ -107,9 +107,9 @@ class Chef
end
def to_hash
- result = self.raw_data
+ result = self.raw_data.dup
result["chef_type"] = "data_bag_item"
- result["data_bag"] = self.data_bag
+ result["data_bag"] = self.data_bag.to_s
result
end