public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Make partial counter start from 0.

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
fcheung (author)
Thu Jun 05 12:48:42 -0700 2008
lifo (committer)
Thu Jun 05 14:11:40 -0700 2008
commit  2e0765a00361781fb9bff2a7ca8996eab1f01bd4
tree    052d0f7d37f1e25cba948f3de7d396cfb911f52d
parent  df8154c845f8fb251c58f1fd882cc221cfdcbbc2
...
22
23
24
25
26
27
28
 
29
30
31
...
22
23
24
 
25
26
27
28
29
30
31
0
@@ -22,10 +22,10 @@ module ActionView #:nodoc:
0
     end
0
     
0
     def render_member(object)
0
- @locals[@counter_name] += 1
0
       @locals[:object] = @locals[@variable_name] = object
0
       
0
       template = render_template
0
+ @locals[@counter_name] += 1
0
       @locals.delete(@variable_name)
0
       @locals.delete(:object)
0
       
...
742
743
744
745
 
746
747
748
...
762
763
764
765
 
766
767
768
...
742
743
744
 
745
746
747
748
...
762
763
764
 
765
766
767
768
0
@@ -742,7 +742,7 @@ EOS
0
   
0
   def test_partial_collection_with_counter
0
     get :partial_collection_with_counter
0
- assert_equal "david1mary2", @response.body
0
+ assert_equal "david0mary1", @response.body
0
   end
0
   
0
   def test_partial_collection_with_locals
0
@@ -762,7 +762,7 @@ EOS
0
 
0
   def test_partial_collection_shorthand_with_different_types_of_records
0
     get :partial_collection_shorthand_with_different_types_of_records
0
- assert_equal "Bonjour bad customer: mark1Bonjour good customer: craig2Bonjour bad customer: john3Bonjour good customer: zach4Bonjour good customer: brandon5Bonjour bad customer: dan6", @response.body
0
+ assert_equal "Bonjour bad customer: mark0Bonjour good customer: craig1Bonjour bad customer: john2Bonjour good customer: zach3Bonjour good customer: brandon4Bonjour bad customer: dan5", @response.body
0
   end
0
 
0
   def test_empty_partial_collection

Comments

  • chriseppstein Fri Jun 06 15:50:27 -0700 2008

    Now we have to go and change our code back to expecting a 1-based index. ::sigh::

  • jeremy Fri Jun 06 19:28:11 -0700 2008

    Sigh? It’s fixed, man—rejoice!!

  • ambethia Mon Jun 09 12:19:07 -0700 2008

    Thanks for fixing this, I got flustered when I read that the 1-based index was desired behavior*. From the changes here, it looks as if this was an unintended bug after all?