This project is archived and is in readonly mode.
JSON.dump({}) raise NoMethodError
Reported by okkez | November 12th, 2009 @ 01:27 PM
This code raise NoMethodError.
require 'rubygems'
require 'activesupport'
JSON.dump({}) # raise NoMethodError
but,
require 'rubygems'
require 'json'
JSON.dump({}) # => "{}"
In 'active_support/json/encoders/hash.rb' Hash#as_json or
Hash#to_json is wrong.
I attached a simple patch for this problem.
Comments and changes to this ticket
-
okkez November 13th, 2009 @ 12:16 PM
I attached a wrong patch(a.diff). I did not want to change magic comment.
I reattach a patch(b.diff). -
windock February 17th, 2010 @ 12:38 AM
Can reproduce with ActiveSupport 2.3.5 and Json 1.2.0
Patch fixes the problem. -
Ryan Bigg October 14th, 2010 @ 08:14 AM
- State changed from new to resolved
- Importance changed from to
Cannot reproduce with Active Support 3 therefore I am assuming this is fixed.
Closing.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>