This project is archived and is in readonly mode.
[PATCH] Rails 3.0: each_with_index fails
Reported by Christoph Petschnig | November 21st, 2009 @ 11:12 PM | in 3.0.2
When using method :each_with_index on a query result (like MyModel.find :all), Rails fails with message:
undefined method my_model_column_name' for
#<Arel::Row:0x9ed7fc0>
The solution is to delegate :each_with_index in activerecord/lib/active_record/relation.rb
Comments and changes to this ticket
-
Jeremy Kemper November 22nd, 2009 @ 08:09 AM
- Assigned user set to Jeremy Kemper
- State changed from new to open
- Milestone cleared.
Good. Just needs a test case!
-
Christoph Petschnig November 25th, 2009 @ 06:48 AM
Update with a better test of the functionality of each_with_index
-
Rizwan Reza January 16th, 2010 @ 08:47 PM
- Tag set to 3.0, patch, review
-
Rizwan Reza January 16th, 2010 @ 08:57 PM
Pratik says this can be handled in method_missing like associations.
-
Rizwan Reza January 16th, 2010 @ 09:00 PM
- Assigned user changed from Jeremy Kemper to Pratik
Just got the news from Pratik that this is already fixed.
-
José Valim January 17th, 2010 @ 03:35 PM
- State changed from open to resolved
-
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>