aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-01-23 08:37:58 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2008-01-23 08:37:58 +0000
commit2cd8424aaeb4b4757d532783be8ef0da1e778f88 (patch)
tree2b1aee1a24b0d6bbdb45dcae78c3f76d4895fd1c /actionpack
parent8273280a637a5e40de2c37dd1da507c749b11aab (diff)
downloadrails-2cd8424aaeb4b4757d532783be8ef0da1e778f88.tar.gz
rails-2cd8424aaeb4b4757d532783be8ef0da1e778f88.tar.bz2
rails-2cd8424aaeb4b4757d532783be8ef0da1e778f88.zip
Preserve integration session's request_count
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8701 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rwxr-xr-xactionpack/lib/action_controller/request_profiler.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/request_profiler.rb b/actionpack/lib/action_controller/request_profiler.rb
index 5b92f3740f..6a023b652e 100755
--- a/actionpack/lib/action_controller/request_profiler.rb
+++ b/actionpack/lib/action_controller/request_profiler.rb
@@ -41,7 +41,16 @@ module ActionController
private
def define_run_method(script_path)
script = File.read(script_path)
- source = "def run\n#{script}\nreset!\nend"
+
+ source = <<-end_source
+ def run
+ #{script}
+ old_request_count = request_count
+ reset!
+ self.request_count = old_request_count
+ end
+ end_source
+
instance_eval source, script_path, 1
end