<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,7 @@
 *2.2.1 [RC2 or 2.2 final]*
 
+* Fixed that polymorphic_url should compact given array #1317 [hiroshi]
+
 * Fixed the sanitize helper to avoid double escaping already properly escaped entities #683 [antonmos/Ryan McGeary]
 
 * Fixed that FormTagHelper generated illegal html if name contained square brackets #1238 [Vladimir Dobriakov]</diff>
      <filename>actionpack/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -73,7 +73,7 @@ module ActionController
     #
     def polymorphic_url(record_or_hash_or_array, options = {})
       if record_or_hash_or_array.kind_of?(Array)
-        record_or_hash_or_array = record_or_hash_or_array.dup
+        record_or_hash_or_array = record_or_hash_or_array.compact
       end
 
       record    = extract_record(record_or_hash_or_array)</diff>
      <filename>actionpack/lib/action_controller/polymorphic_routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -169,6 +169,17 @@ uses_mocha 'polymorphic URL helpers' do
       polymorphic_url([@article, :response, @tag], :format =&gt; :pdf)
     end
 
+    def test_nesting_with_array_containing_nil
+      expects(:article_response_url).with(@article)
+      polymorphic_url([@article, nil, :response])
+    end
+
+    def test_with_array_containing_single_object
+      @article.save
+      expects(:article_url).with(@article)
+      polymorphic_url([nil, @article])
+    end
+
     # TODO: Needs to be updated to correctly know about whether the object is in a hash or not
     def xtest_with_hash
       expects(:article_url).with(@article)</diff>
      <filename>actionpack/test/controller/polymorphic_routes_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ff4ccb8334e4f5b5bdccbd5dc6876b4e43d9565e</id>
    </parent>
  </parents>
  <author>
    <name>hiroshi</name>
    <login>hiroshi</login>
    <email>hiroshi3110@gmail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/94d6716324126028b89dde886f160474049b1b0c</url>
  <id>94d6716324126028b89dde886f160474049b1b0c</id>
  <committed-date>2008-11-14T03:07:52-08:00</committed-date>
  <authored-date>2008-11-02T21:09:07-08:00</authored-date>
  <message>Make polymorphic_url compact given array [#1317 state:committed]

Signed-off-by: David Heinemeier Hansson &lt;david@loudthinking.com&gt;</message>
  <tree>c40c86bb253900d68717684d0fbae89bc1936406</tree>
  <committer>
    <name>David Heinemeier Hansson</name>
    <login>dhh</login>
    <email>david@loudthinking.com</email>
  </committer>
</commit>
