aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2009-12-31 01:15:30 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2009-12-31 01:15:30 -0500
commit96c27e4003b803b9ac1a3581dfe1c181ba79556a (patch)
tree24a6c8573dfe3aa01abd4464eafbeb86e96cd250 /actionpack
parent5d8342cc325bc9f46bfe61bf3534248b6ad3216f (diff)
parentc4c2502df8b0b7b5fa28d796bdb1d4bd02af4b3d (diff)
downloadrails-96c27e4003b803b9ac1a3581dfe1c181ba79556a.tar.gz
rails-96c27e4003b803b9ac1a3581dfe1c181ba79556a.tar.bz2
rails-96c27e4003b803b9ac1a3581dfe1c181ba79556a.zip
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/rails.rb3
-rw-r--r--actionpack/lib/action_dispatch.rb2
-rw-r--r--actionpack/test/activerecord/controller_runtime_test.rb39
3 files changed, 41 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/rails.rb b/actionpack/lib/action_controller/rails.rb
index 6ebb50887b..df708c315b 100644
--- a/actionpack/lib/action_controller/rails.rb
+++ b/actionpack/lib/action_controller/rails.rb
@@ -1,7 +1,6 @@
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|
@@ -91,4 +90,4 @@ module ActionController
end
end
-end \ No newline at end of file
+end
diff --git a/actionpack/lib/action_dispatch.rb b/actionpack/lib/action_dispatch.rb
index 7f61ff5657..1e87a016f9 100644
--- a/actionpack/lib/action_dispatch.rb
+++ b/actionpack/lib/action_dispatch.rb
@@ -23,7 +23,7 @@
activesupport_path = File.expand_path('../../../activesupport/lib', __FILE__)
$:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path)
-require 'active_support/ruby/shim'
+require 'active_support'
require 'active_support/dependencies/autoload'
require 'rack'
diff --git a/actionpack/test/activerecord/controller_runtime_test.rb b/actionpack/test/activerecord/controller_runtime_test.rb
new file mode 100644
index 0000000000..0f534da14b
--- /dev/null
+++ b/actionpack/test/activerecord/controller_runtime_test.rb
@@ -0,0 +1,39 @@
+require 'active_record_unit'
+require 'active_record/railties/controller_runtime'
+require 'fixtures/project'
+
+ActionController::Base.send :include, ActiveRecord::Railties::ControllerRuntime
+
+class ARLoggingController < ActionController::Base
+ def show
+ render :inline => "<%= Project.all %>"
+ end
+end
+
+class ARLoggingTest < ActionController::TestCase
+ tests ARLoggingController
+
+ def setup
+ super
+ set_logger
+ end
+
+ def wait
+ ActiveSupport::Notifications.notifier.wait
+ end
+
+ def test_log_with_active_record
+ get :show
+ wait
+ assert_match /ActiveRecord runtime/, logs[3]
+ end
+
+ private
+ def set_logger
+ @controller.logger = MockLogger.new
+ end
+
+ def logs
+ @logs ||= @controller.logger.logged.compact.map {|l| l.to_s.strip}
+ end
+end