aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_view/partials.rb2
-rw-r--r--actionpack/test/controller/new_render_test.rb2
3 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index c3c54727ed..afa3e12834 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -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]
diff --git a/actionpack/lib/action_view/partials.rb b/actionpack/lib/action_view/partials.rb
index be9d40ca53..06dead1b23 100644
--- a/actionpack/lib/action_view/partials.rb
+++ b/actionpack/lib/action_view/partials.rb
@@ -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
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index da8b2b2a46..e9c7ee67e1 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -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