aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/rails.rb
diff options
context:
space:
mode:
authorYehuda Katz <wycats@Yehuda-Katz.local>2009-12-27 14:36:59 -0800
committerYehuda Katz <wycats@Yehuda-Katz.local>2009-12-27 14:36:59 -0800
commit12e43494a748e0144195be12dc19161cc3e4d39f (patch)
treec06f88b7ddf6e41205838cc6f4edd2257a801dcb /actionpack/lib/action_controller/rails.rb
parent1c26ba486c23f229a12fea6ccad33e6cb3122b91 (diff)
parent97db79ab3c0af7b6805dcaee99384d96ccb3567d (diff)
downloadrails-12e43494a748e0144195be12dc19161cc3e4d39f.tar.gz
rails-12e43494a748e0144195be12dc19161cc3e4d39f.tar.bz2
rails-12e43494a748e0144195be12dc19161cc3e4d39f.zip
Merge remote branch 'jose/perf'
Diffstat (limited to 'actionpack/lib/action_controller/rails.rb')
-rw-r--r--actionpack/lib/action_controller/rails.rb14
1 files changed, 3 insertions, 11 deletions
diff --git a/actionpack/lib/action_controller/rails.rb b/actionpack/lib/action_controller/rails.rb
index 36a52b3149..6ebb50887b 100644
--- a/actionpack/lib/action_controller/rails.rb
+++ b/actionpack/lib/action_controller/rails.rb
@@ -1,6 +1,7 @@
module ActionController
class Plugin < Rails::Plugin
plugin_name :action_controller
+ include_modules_in "ActionController::Base"
initializer "action_controller.set_configs" do |app|
app.config.action_controller.each do |k,v|
@@ -14,10 +15,6 @@ module ActionController
end
# Routing must be initialized after plugins to allow the former to extend the routes
- # ---
- # If Action Controller is not one of the loaded frameworks (Configuration#frameworks)
- # this does nothing. Otherwise, it loads the routing definitions and sets up
- # loading module used to lazily load controllers (Configuration#controller_paths).
initializer "action_controller.initialize_routing" do |app|
app.route_configuration_files << app.config.routes_configuration_file
app.route_configuration_files << app.config.builtin_routes_configuration_file
@@ -88,13 +85,8 @@ module ActionController
initializer "action_controller.notifications" do |app|
require 'active_support/notifications'
- ActiveSupport::Notifications.subscribe(/(read|write|cache|expire|exist)_(fragment|page)\??/) do |*args|
- event = ActiveSupport::Notifications::Event.new(*args)
-
- if logger = ActionController::Base.logger
- human_name = event.name.to_s.humanize
- logger.info("#{human_name} (%.1fms)" % event.duration)
- end
+ ActiveSupport::Notifications.subscribe do |*args|
+ ActionController::Base.log_event(*args) if ActionController::Base.logger
end
end