aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/lib/action_controller/middlewares.rb8
-rw-r--r--railties/lib/initializer.rb1
2 files changed, 4 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/middlewares.rb b/actionpack/lib/action_controller/middlewares.rb
index 30dbc26f11..f9cfc2b18e 100644
--- a/actionpack/lib/action_controller/middlewares.rb
+++ b/actionpack/lib/action_controller/middlewares.rb
@@ -4,8 +4,6 @@ use "Rack::Lock", :if => lambda {
use "ActionController::Failsafe"
-use "ActiveRecord::QueryCache", :if => lambda { defined?(ActiveRecord) }
-
["ActionController::Session::CookieStore",
"ActionController::Session::MemCacheStore",
"ActiveRecord::SessionStore"].each do |store|
@@ -18,6 +16,6 @@ use "ActiveRecord::QueryCache", :if => lambda { defined?(ActiveRecord) }
)
end
-use ActionController::RewindableInput
-use ActionController::ParamsParser
-use Rack::MethodOverride
+use "ActionController::RewindableInput"
+use "ActionController::ParamsParser"
+use "Rack::MethodOverride"
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index dd4d483233..be04873855 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -408,6 +408,7 @@ Run `rake gems:install` to install the missing gems.
if configuration.frameworks.include?(:active_record)
ActiveRecord::Base.configurations = configuration.database_configuration
ActiveRecord::Base.establish_connection
+ configuration.middleware.use ActiveRecord::QueryCache
end
end