diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-06-08 19:30:27 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-06-08 19:37:52 -0700 |
commit | 5b256ac36922b4dfa4ab7aa639757c4817d06680 (patch) | |
tree | ee76f5cd6cb41fa347142862cf135c96dae88ba8 /activeresource/lib/active_resource/formats/json_format.rb | |
parent | 14de1a9597b35df43aeb03ad91aadb098b1a4d01 (diff) | |
download | rails-5b256ac36922b4dfa4ab7aa639757c4817d06680.tar.gz rails-5b256ac36922b4dfa4ab7aa639757c4817d06680.tar.bz2 rails-5b256ac36922b4dfa4ab7aa639757c4817d06680.zip |
Prefer JSON.encode(value) to value.to_json
Diffstat (limited to 'activeresource/lib/active_resource/formats/json_format.rb')
-rw-r--r-- | activeresource/lib/active_resource/formats/json_format.rb | 4 |
1 files 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) |