From 5b256ac36922b4dfa4ab7aa639757c4817d06680 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 8 Jun 2009 19:30:27 -0700 Subject: Prefer JSON.encode(value) to value.to_json --- activeresource/lib/active_resource/formats/json_format.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activeresource/lib/active_resource/formats/json_format.rb b/activeresource/lib/active_resource/formats/json_format.rb index 101027d99e..9980634921 100644 --- a/activeresource/lib/active_resource/formats/json_format.rb +++ b/activeresource/lib/active_resource/formats/json_format.rb @@ -13,8 +13,8 @@ module ActiveResource "application/json" end - def encode(hash, options={}) - hash.to_json(options) + def encode(hash, options = nil) + ActiveSupport::JSON.encode(hash, options) end def decode(json) -- cgit v1.2.3