mirror of
https://github.com/github/rails.git
synced 2026-01-08 22:27:59 -05:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user