Make sure Active Support configurations are applied correctly

Before this patch configuration set using config.active_support
would not be set.

Closes #15364
This commit is contained in:
Rafael Mendonça França
2014-06-26 18:37:48 -03:00
parent bc90ea63e9
commit 297bff7f8f
2 changed files with 19 additions and 0 deletions

View File

@@ -55,5 +55,12 @@ module ActiveSupport
Time.zone_default = zone_default
end
initializer "active_support.set_configs" do |app|
app.config.active_support.each do |k, v|
k = "#{k}="
ActiveSupport.send(k, v) if ActiveSupport.respond_to? k
end
end
end
end

View File

@@ -454,6 +454,18 @@ module ApplicationTests
assert ActionView::Resolver.caching?
end
test "configure Active Support using config.active_support" do
add_to_config <<-RUBY
config.active_support.escape_html_entities_in_json = true
RUBY
require 'active_support/json'
require "#{app_path}/config/environment"
assert ActiveSupport.escape_html_entities_in_json
assert ActiveSupport::JSON::Encoding.escape_html_entities_in_json
end
test "config.action_dispatch.show_exceptions is sent in env" do
make_basic_app do |app|
app.config.action_dispatch.show_exceptions = true