aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-03-08 15:57:07 -0800
committerCarlhuda <carlhuda@engineyard.com>2010-03-08 16:50:00 -0800
commit146a5305d56b636d2fd2c2a09a58f5f3edc2d9c0 (patch)
treecef0ad169ffaf123d914c426ae1933e47db648e8 /actionpack/lib/action_dispatch/http
parent60bbf16bfd60493c05bf9c9c70ec962a0c482155 (diff)
downloadrails-146a5305d56b636d2fd2c2a09a58f5f3edc2d9c0.tar.gz
rails-146a5305d56b636d2fd2c2a09a58f5f3edc2d9c0.tar.bz2
rails-146a5305d56b636d2fd2c2a09a58f5f3edc2d9c0.zip
Add memoizing to AD::Request
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rwxr-xr-xactionpack/lib/action_dispatch/http/request.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index 56a2b9bf6a..ea9f0f99c2 100755
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -30,6 +30,14 @@ module ActionDispatch
METHOD
end
+ def self.new(env)
+ if request = env["action_dispatch.request"] && request.instance_of?(self)
+ return request
+ end
+
+ super
+ end
+
def key?(key)
@env.key?(key)
end