summaryrefslogtreecommitdiff
path: root/lib/chef/data_bag_item.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-08-11 17:36:52 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-08-11 17:36:52 -0700
commit3f415b11dfb1c494a45a0a83d69196cd75924cf1 (patch)
treeee6bbff8836a1a8514fe3be7ce9ead67ad8cb02a /lib/chef/data_bag_item.rb
parentb4dfc6a1f478f29105a3b4746029e3ad46291b82 (diff)
downloadchef-3f415b11dfb1c494a45a0a83d69196cd75924cf1.tar.gz
remove JSON gem usage
should fully convert to using ffi-yajl there are still issues with JSON gem monkeypatching interacting with chef-zero and the spec tests so we keep the requires here for the json gem and the ffi_yajl/json_gem here. when ohai and chef-zero are fixed, we an just require ffi_yajl.
Diffstat (limited to 'lib/chef/data_bag_item.rb')
-rw-r--r--lib/chef/data_bag_item.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/chef/data_bag_item.rb b/lib/chef/data_bag_item.rb
index 07dd15a1dc..6f0ae65478 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" => self.object_name,
+ "name" => object_name,
"json_class" => self.class.name,
- "chef_type" => "data_bag_item",
- "data_bag" => self.data_bag,
- "raw_data" => self.raw_data
+ "chef_type" => "data_bag_item",
+ "data_bag" => data_bag,
+ "raw_data" => raw_data
}
- result.to_json(*a)
+ Chef::JSONCompat.to_json(result, *a)
end
def self.from_hash(h)
@@ -210,5 +210,3 @@ class Chef
end
end
-
-