aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
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