Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Changeset [d052e9fb5868a10df33a84bf61f40a32df9e78ec] by rick

Revision d052e9fb5868a10df33a84bf61f40a32df9e78ec, committed by rick · May 18th, 2009 @ 02:40 AM

Add pluggable JSON backends with support for the JSON gem.

Example: ActiveSupport::JSON.backend = "JSONGem"

All internal Rails JSON encoding is now handled by ActiveSupport::JSON.encode(). Use of #to_json is not recommended, as it may clash with other libraries that overwrite it. However, you can recover Rails specific functionality if you really want to use #to_json.

gem 'json'
ActiveSupport::JSON.backend = "JSONGem"

class ActiveRecord::Base
  alias to_json rails_to_json
end

http://github.com/rails/rails/co...

31 changed files

  • M actionpack/lib/action_controller/base.rb
  • M actionpack/lib/action_view/helpers/prototype_helper.rb
  • M actionpack/lib/action_view/helpers/scriptaculous_helper.rb
  • M actionpack/test/controller/render_test.rb
  • M actionpack/test/template/prototype_helper_test.rb
  • M activerecord/lib/active_record/serializers/json_serializer.rb
  • M activerecord/test/cases/json_serialization_test.rb
  • M activeresource/lib/active_resource/base.rb
  • M activesupport/lib/active_support/json.rb
  • M activesupport/lib/active_support/json/backends/jsongem.rb
  • M activesupport/lib/active_support/json/backends/yaml.rb
  • M activesupport/lib/active_support/json/decoding.rb
  • M activesupport/lib/active_support/json/encoders/date.rb
  • M activesupport/lib/active_support/json/encoders/date_time.rb
  • M activesupport/lib/active_support/json/encoders/enumerable.rb
  • M activesupport/lib/active_support/json/encoders/false_class.rb
  • M activesupport/lib/active_support/json/encoders/hash.rb
  • M activesupport/lib/active_support/json/encoders/nil_class.rb
  • M activesupport/lib/active_support/json/encoders/numeric.rb
  • M activesupport/lib/active_support/json/encoders/object.rb
  • M activesupport/lib/active_support/json/encoders/regexp.rb
  • M activesupport/lib/active_support/json/encoders/string.rb
  • M activesupport/lib/active_support/json/encoders/symbol.rb
  • M activesupport/lib/active_support/json/encoders/time.rb
  • M activesupport/lib/active_support/json/encoders/true_class.rb
  • M activesupport/lib/active_support/json/encoding.rb
  • M activesupport/lib/active_support/json/variable.rb
  • M activesupport/lib/active_support/time_with_zone.rb
  • M activesupport/test/core_ext/time_with_zone_test.rb
  • M activesupport/test/json/decoding_test.rb
  • M activesupport/test/json/encoding_test.rb