Fixed bug when a partial render was passing a local with the same name as the partial

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1942 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2005-07-27 12:24:14 +00:00
parent d9033bbb28
commit 3d2f0001ea
3 changed files with 4 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
*SVN*
* Fixed bug when a partial render was passing a local with the same name as the partial
* Improved performance of test app req/sec with ~10% refactoring the render method #1823 [Stefan Kaes]
* Improved performance of test app req/sec with 5-30% through a series of Action Pack optimizations #1811 [Stefan Kaes]

View File

@@ -52,7 +52,7 @@ module ActionView
local_assigns = extract_local_assigns(local_assigns, deprecated_local_assigns)
local_assigns = local_assigns ? local_assigns.clone : {}
add_counter_to_local_assigns!(partial_name, local_assigns)
local_assigns[partial_name] = object
local_assigns[partial_name.intern] ||= object
render("#{path}/_#{partial_name}", local_assigns)
end

View File

@@ -330,7 +330,7 @@ class NewRenderTest < Test::Unit::TestCase
def test_partial_with_locals
get :partial_with_locals
assert_equal "Hello: David", @response.body
assert_equal "Hello: david", @response.body
end
def test_partial_collection