Avoid to define an initializer after the load_config_initializers

This make the config/initializers run before the railties are loaded
what can break some configurations.
This commit is contained in:
Rafael Mendonça França 2015-04-07 17:19:33 -03:00
parent 44cfb2ab8a
commit 0a120a818d
3 changed files with 9 additions and 8 deletions

View File

@ -73,6 +73,14 @@ module ActiveSupport
end
cattr_accessor :test_order # :nodoc:
def self.halt_callback_chains_on_return_false
Callbacks::CallbackChain.halt_and_display_warning_on_return_false
end
def self.halt_callback_chains_on_return_false=(value)
Callbacks::CallbackChain.halt_and_display_warning_on_return_false = value
end
end
autoload :I18n, "active_support/i18n"

View File

@ -13,13 +13,6 @@ module ActiveSupport
end
end
initializer "active_support.halt_callback_chains_on_return_false", after: :load_config_initializers do |app|
if app.config.active_support.key? :halt_callback_chains_on_return_false
ActiveSupport::Callbacks::CallbackChain.halt_and_display_warning_on_return_false = \
app.config.active_support.halt_callback_chains_on_return_false
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|

View File

@ -1,4 +1,4 @@
# Be sure to restart your server when you modify this file.
# Do not halt callback chains when a callback returns false.
Rails.application.config.active_support.halt_callback_chains_on_return_false = false
ActiveSupport.halt_callback_chains_on_return_false = false