mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Moved initializers for ActionMailer and ActionController into their own railties
This commit is contained in:
@@ -16,6 +16,11 @@ module ActionMailer
|
||||
ActionMailer::Base.logger ||= Rails.logger
|
||||
end
|
||||
|
||||
initializer "action_mailer.add_view_paths" do |app|
|
||||
views = app.config.paths.app.views.to_a
|
||||
ActionMailer::Base.prepend_view_path(views)
|
||||
end
|
||||
|
||||
initializer "action_mailer.set_configs" do |app|
|
||||
app.config.action_mailer.each do |k,v|
|
||||
ActionMailer::Base.send "#{k}=", v
|
||||
|
||||
@@ -27,6 +27,11 @@ module ActionController
|
||||
ActionController::Base.cache_store ||= RAILS_CACHE
|
||||
end
|
||||
|
||||
initializer "action_controller.add_view_paths" do |app|
|
||||
views = app.config.paths.app.views.to_a
|
||||
ActionController::Base.prepend_view_path(views)
|
||||
end
|
||||
|
||||
initializer "action_controller.set_helpers_path" do |app|
|
||||
ActionController::Base.helpers_path = app.config.paths.app.helpers.to_a
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
require "active_support/notifications"
|
||||
|
||||
module Rails
|
||||
class Application
|
||||
module Bootstrap
|
||||
@@ -49,20 +51,6 @@ module Rails
|
||||
end
|
||||
end
|
||||
|
||||
# Initialize rails log subscriber on top of notifications.
|
||||
initializer :initialize_log_subscriber do
|
||||
require 'active_support/notifications'
|
||||
|
||||
if config.colorize_logging == false
|
||||
Rails::LogSubscriber.colorize_logging = false
|
||||
config.generators.colorize_logging = false
|
||||
end
|
||||
|
||||
ActiveSupport::Notifications.subscribe do |*args|
|
||||
Rails::LogSubscriber.dispatch(args)
|
||||
end
|
||||
end
|
||||
|
||||
initializer :set_clear_dependencies_hook do
|
||||
unless config.cache_classes
|
||||
ActionDispatch::Callbacks.after do
|
||||
|
||||
Reference in New Issue
Block a user