提交 45f6dcd9 编写于 作者: S Santiago Pastorino

Move AS set configs to AS Raitie

上级 bae190c5
......@@ -24,5 +24,12 @@ class Railtie < Rails::Railtie
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
......@@ -10,17 +10,7 @@ module Bootstrap
initializer :load_environment_hook, :group => :all do end
initializer :load_active_support, :group => :all do
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
require "active_support/all" unless config.active_support.bare
end
# Preload all frameworks specified by the Configuration#frameworks.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册