Moved initializers for ActionMailer and ActionController into their own railties

This commit is contained in:
Carlhuda
2010-03-02 12:32:31 -08:00
parent 57bae9764e
commit b01db07a9f
3 changed files with 12 additions and 14 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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