mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge branch 'master' of git@github.com:rails/rails
This commit is contained in:
commit
7857e42103
3 changed files with 6 additions and 2 deletions
|
@ -181,7 +181,7 @@ module ActionView
|
|||
ActionController::RecordIdentifier.partial_path(object, controller.class.controller_path)
|
||||
template = _pick_partial_template(_partial_path)
|
||||
local_assigns[template.counter_name] = index
|
||||
result = template.render_partial(self, object, local_assigns, as)
|
||||
result = template.render_partial(self, object, local_assigns.dup, as)
|
||||
index += 1
|
||||
result
|
||||
end.join(spacer)
|
||||
|
|
2
actionpack/test/fixtures/test/_customer.erb
vendored
2
actionpack/test/fixtures/test/_customer.erb
vendored
|
@ -1 +1 @@
|
|||
Hello: <%= customer.name %>
|
||||
Hello: <%= customer.name rescue "Anonymous" %>
|
|
@ -115,6 +115,10 @@ class ViewRenderTest < Test::Unit::TestCase
|
|||
assert_nil @view.render(:partial => "test/customer", :collection => nil)
|
||||
end
|
||||
|
||||
def test_render_partial_with_nil_values_in_collection
|
||||
assert_equal "Hello: davidHello: Anonymous", @view.render(:partial => "test/customer", :collection => [ Customer.new("david"), nil ])
|
||||
end
|
||||
|
||||
def test_render_partial_with_empty_array_should_return_nil
|
||||
assert_nil @view.render(:partial => [])
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue