Permalink
Browse files

Moved initializers for ActionMailer and ActionController into their o…

…wn railties
  • Loading branch information...
1 parent 57bae97 commit b01db07a9f009016186da34c4936a9efb2c224c6 Carlhuda committed Mar 2, 2010
@@ -16,6 +16,11 @@ class Railtie < Rails::Railtie
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 @@ class Railtie < Rails::Railtie
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 Bootstrap
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

0 comments on commit b01db07

Please sign in to comment.