diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-05-12 08:48:58 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-05-12 08:48:58 -0700 |
commit | bae190c5a6bab464681da9e0f53471a5a7301f41 (patch) | |
tree | c968643d51f3eae2a7b2e0c9637657ad1e8a7e73 /railties/lib/rails | |
parent | e5b91f2b1dd8b1c7a6d01d78e50b852dbc37127f (diff) | |
parent | 5613fb0b8751440f162ffc59869848ecb41acaf2 (diff) | |
download | rails-bae190c5a6bab464681da9e0f53471a5a7301f41.tar.gz rails-bae190c5a6bab464681da9e0f53471a5a7301f41.tar.bz2 rails-bae190c5a6bab464681da9e0f53471a5a7301f41.zip |
Merge pull request #6271 from homakov/patch-5
configuration for active_support and JSON Encoding
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/application/bootstrap.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/railties/lib/rails/application/bootstrap.rb b/railties/lib/rails/application/bootstrap.rb index e567df7162..15c5766395 100644 --- a/railties/lib/rails/application/bootstrap.rb +++ b/railties/lib/rails/application/bootstrap.rb @@ -10,7 +10,17 @@ module Rails 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. |