summaryrefslogtreecommitdiff
path: root/lib/chef/data_bag_item.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-08-09 10:05:47 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-08-09 10:05:47 -0700
commitb7a5d28ac34d4661bb8a4e2e92d25e023f60f987 (patch)
tree99fede241b3b91687a15e55a9d045885562c8056 /lib/chef/data_bag_item.rb
parentadbb0fa85cc45b93ba91dc3019094b312cafb35c (diff)
downloadchef-b7a5d28ac34d4661bb8a4e2e92d25e023f60f987.tar.gz
Revert "remove #to_json Monkeytpatching"
This reverts commit adbb0fa85cc45b93ba91dc3019094b312cafb35c.
Diffstat (limited to 'lib/chef/data_bag_item.rb')
-rw-r--r--lib/chef/data_bag_item.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/chef/data_bag_item.rb b/lib/chef/data_bag_item.rb
index a537880f41..07dd15a1dc 100644
--- a/lib/chef/data_bag_item.rb
+++ b/lib/chef/data_bag_item.rb
@@ -112,13 +112,13 @@ class Chef
# Serialize this object as a hash
def to_json(*a)
result = {
- "name" => object_name,
+ "name" => self.object_name,
"json_class" => self.class.name,
- "chef_type" => "data_bag_item",
- "data_bag" => data_bag,
- "raw_data" => raw_data
+ "chef_type" => "data_bag_item",
+ "data_bag" => self.data_bag,
+ "raw_data" => self.raw_data
}
- ::Chef::JSONCompat.to_json(result, *a)
+ result.to_json(*a)
end
def self.from_hash(h)
@@ -210,3 +210,5 @@ class Chef
end
end
+
+