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

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
fcheung (author)
Thu Jun 05 12:48:42 -0700 2008
lifo (committer)
Thu Jun 05 13:03:53 -0700 2008
commit  a04bfacbf01973c214215dd5a547f3e9fa8028ff
tree    63825a3ce658e6ddea993190611865f08bfa701c
parent  cce30f71246dbc5433153156afa4f952553ad13d
...
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