mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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:
parent
44cfb2ab8a
commit
0a120a818d
3 changed files with 9 additions and 8 deletions
|
@ -73,6 +73,14 @@ module ActiveSupport
|
||||||
end
|
end
|
||||||
|
|
||||||
cattr_accessor :test_order # :nodoc:
|
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
|
end
|
||||||
|
|
||||||
autoload :I18n, "active_support/i18n"
|
autoload :I18n, "active_support/i18n"
|
||||||
|
|
|
@ -13,13 +13,6 @@ module ActiveSupport
|
||||||
end
|
end
|
||||||
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
|
# Sets the default value for Time.zone
|
||||||
# If assigned value cannot be matched to a TimeZone, an exception will be raised.
|
# If assigned value cannot be matched to a TimeZone, an exception will be raised.
|
||||||
initializer "active_support.initialize_time_zone" do |app|
|
initializer "active_support.initialize_time_zone" do |app|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
# Do not halt callback chains when a callback returns false.
|
# 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
|
||||||
|
|
Loading…
Reference in a new issue