From 146a5305d56b636d2fd2c2a09a58f5f3edc2d9c0 Mon Sep 17 00:00:00 2001 From: Carlhuda Date: Mon, 8 Mar 2010 15:57:07 -0800 Subject: Add memoizing to AD::Request --- actionpack/lib/action_dispatch/http/request.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack/lib/action_dispatch/http') 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 -- cgit v1.2.3