mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Preserve integration session's request_count
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8701 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
8273280a63
commit
2cd8424aae
1 changed files with 10 additions and 1 deletions
|
@ -41,7 +41,16 @@ module ActionController
|
||||||
private
|
private
|
||||||
def define_run_method(script_path)
|
def define_run_method(script_path)
|
||||||
script = File.read(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
|
instance_eval source, script_path, 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue