Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATCH] Rails 3.0: each_with_index fails

#3501

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

Reported by Christoph Petschnig · November 21st, 2009 @ 11:12 PM

State: resolved
Milestone: 3.0.2
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Jeremy Kemper
    Jeremy Kemper
    • Assigned user set to Jeremy Kemper
    • State changed from new to open
    • Milestone cleared.

    Good. Just needs a test case!

    November 22nd, 2009 @ 08:09 AM

  2. Christoph Petschnig
  3. Christoph Petschnig
    Christoph Petschnig

    Update with a better test of the functionality of each_with_index

    November 25th, 2009 @ 06:48 AM

  4. Rizwan Reza
    Rizwan Reza
    • Tag set to 3.0, patch, review

    January 16th, 2010 @ 08:47 PM

  5. Rizwan Reza
    Rizwan Reza

    The patch does not apply cleanly to master anymore.

    January 16th, 2010 @ 08:49 PM

  6. Rizwan Reza
    Rizwan Reza

    Pratik says this can be handled in method_missing like associations.

    January 16th, 2010 @ 08:57 PM

  7. Rizwan Reza
    Rizwan Reza
    • Assigned user changed from Jeremy Kemper to Pratik

    Just got the news from Pratik that this is already fixed.

    January 16th, 2010 @ 09:00 PM

  8. José Valim
    José Valim
    • State changed from open to resolved

    January 17th, 2010 @ 03:35 PM

  9. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to

    October 15th, 2010 @ 11:01 PM