lib/active_support/railtie.rb in activesupport-6.0.6.1 vs lib/active_support/railtie.rb in activesupport-6.1.0.rc1
- old
+ new
@@ -20,16 +20,29 @@
initializer "active_support.reset_all_current_attributes_instances" do |app|
app.reloader.before_class_unload { ActiveSupport::CurrentAttributes.clear_all }
app.executor.to_run { ActiveSupport::CurrentAttributes.reset_all }
app.executor.to_complete { ActiveSupport::CurrentAttributes.reset_all }
+
+ ActiveSupport.on_load(:active_support_test_case) do
+ require "active_support/current_attributes/test_helper"
+ include ActiveSupport::CurrentAttributes::TestHelper
+ end
end
initializer "active_support.deprecation_behavior" do |app|
if deprecation = app.config.active_support.deprecation
ActiveSupport::Deprecation.behavior = deprecation
end
+
+ if disallowed_deprecation = app.config.active_support.disallowed_deprecation
+ ActiveSupport::Deprecation.disallowed_behavior = disallowed_deprecation
+ end
+
+ if disallowed_warnings = app.config.active_support.disallowed_deprecation_warnings
+ ActiveSupport::Deprecation.disallowed_warnings = disallowed_warnings
+ end
end
# Sets the default value for Time.zone
# If assigned value cannot be matched to a TimeZone, an exception will be raised.
initializer "active_support.initialize_time_zone" do |app|
@@ -63,17 +76,26 @@
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
+ ActiveSupport.public_send(k, v) if ActiveSupport.respond_to? k
end
end
initializer "active_support.set_hash_digest_class" do |app|
config.after_initialize do
if app.config.active_support.use_sha1_digests
+ ActiveSupport::Deprecation.warn(<<-MSG.squish)
+ config.active_support.use_sha1_digests is deprecated and will
+ be removed from Rails 6.2. Use
+ config.active_support.hash_digest_class = ::Digest::SHA1 instead.
+ MSG
ActiveSupport::Digest.hash_digest_class = ::Digest::SHA1
+ end
+
+ if klass = app.config.active_support.hash_digest_class
+ ActiveSupport::Digest.hash_digest_class = klass
end
end
end
end
end