Permalink
Browse files

Merge pull request #6271 from homakov/patch-5

configuration for active_support and JSON Encoding
  • Loading branch information...
2 parents e5b91f2 + 5613fb0 commit bae190c5a6bab464681da9e0f53471a5a7301f41 @spastorino spastorino committed May 12, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 railties/lib/rails/application/bootstrap.rb
@@ -10,7 +10,17 @@ module Bootstrap
initializer :load_environment_hook, :group => :all do end
initializer :load_active_support, :group => :all do
- require "active_support/all" unless config.active_support.bare
+ unless config.active_support.bare
+ require "active_support/all"
+
+ # Assign config options of JSON encoding
+ [:escape_html_entities_in_json, :use_standard_json_time_format, :encode_big_decimal_as_string].each do |option|
+ value = config.active_support.send(option)
+ if !value.nil?
+ ActiveSupport::JSON::Encoding.send("#{option}=", value)
+ end
+ end
+ end
end
# Preload all frameworks specified by the Configuration#frameworks.

0 comments on commit bae190c

Please sign in to comment.