This project is archived and is in readonly mode.
Yajl backend discovery fails in ActiveSupport::JSON
Reported by Maxime RETY | June 18th, 2010 @ 11:25 AM | in 3.0.2
Hi,
In "activesupport/lib/active_support/json/backends/yajl.rb", there is an attempt to use Yajl as a json backend if 'yajl-ruby' gem is available.
This attempt fails because the require statement is
erroneous:
require 'yajl-ruby' unless defined?(Yajl)
Should be:
require 'yajl' unless defined?(Yajl)
So Yajl isn't used as default decoding backend when gem is available.
Besides, I find a bit confusing that the gem is referenced as 'yajl-ruby' but the require statement is 'yajl'.
This could be fixed easily in rails 2.3.9 (see attached patch).
Thanks.
Comments and changes to this ticket
-
Brian Lopez June 18th, 2010 @ 11:40 PM
Woah, that's my bad. Not sure how that even happend since I swear I just copied this file from http://github.com/brianmario/yajl-rails/blob/master/lib/yajl_rails....
-
Rohit Arondekar June 19th, 2010 @ 02:22 AM
- Milestone cleared.
- State changed from new to verified
- Assigned user set to José Valim
Confirmed.
+1 to the patch. Also required on master as the problem exists there.(applies cleanly on master as well)
Weird, the gem is installed as 'yajl-ruby' and required as 'yajl'.
-
Repository June 19th, 2010 @ 04:12 AM
(from [c7e875abdbc9ffb3162eebd7064a30e75e973337]) Fix Yajl backend discovery in ActiveSupport::JSON
[#4897]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/c7e875abdbc9ffb3162eebd7064a30... -
Repository June 19th, 2010 @ 04:12 AM
- State changed from verified to committed
(from [2c2a5fe8299402f9bce4f163b0fd4187bb8f41a5]) Fix Yajl backend discovery in ActiveSupport::JSON
[#4897 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/2c2a5fe8299402f9bce4f163b0fd41... -
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Low
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>
People watching this ticket
Attachments
Referenced by
- 4897 Yajl backend discovery fails in ActiveSupport::JSON [#4897]
- 4897 Yajl backend discovery fails in ActiveSupport::JSON [#4897 state:committed]