This project is archived and is in readonly mode.

#4897 ✓committed
Maxime RETY

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

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>

Attachments