This project is archived and is in readonly mode.
Partial counters start from 1 in 2.1
-
Jan
!? according to lifo in #rails-contrib this behaviour was desired, not a bug.
-
Pratik
Yeah, but majority of people thought it is more sensible to change this behavior in next major release, and noticing everyone in advanced.
Thanks.
-
DavidBackeus
- Tag set to actionpack, patch
Just to clarify the counter has started from 1 ever since 2.0.2. You have to go back to the 1.2 branch to see it start at 0.
2.0.x: http://github.com/rails/rails/tr...
1.2.x: http://github.com/rails/rails/tr...
I had applications dependent on this behaviour (one of them using 2.0.2) so I was kind of freaked out to see them break. It's also not in the "official" change log (http://gist.github.com/8946) so I can't see how "everyone" was noticed in advance.
In the end I think it makes more sense to start at 0 though so I'll just patch my apps and be happy about it ;)
-
Frederick Cheung
Is that really true? both 1.2 and 2.0 eventually use each_with_index to set the value of the counter when rendering each item in the collection. add_counter_to_local_assigns is only called when rendering a single item (it is a bit weird that the default value of that counter is 1)
I believe Pratik was talking about making it start from 1 in a future version
