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] Join conditions removed on habtm and has many through with conditions or STI

#3979

When utilizing a JoinDependency to load a habtm or has many through association that uses conditions and/or an STI target class that is not the base class, at least the join condition is lost producing incorrect results.

I have provided a patch that is split into 2 commits. The first commit alters the posts.yml and comments.yml fixtures and fixes the tests theses changes break. The second commit presents a new failing test case and the fix.

Reported by David Genord II · February 17th, 2010 @ 04:38 PM

State: resolved
Milestone: none
Assigned to: Aaron Patterson Aaron Patterson
Importance: Low

Activity

  1. David Genord II
    David Genord II

    Found another point of failure and updated the patch

    February 17th, 2010 @ 05:17 PM

  2. David Genord II
    David Genord II
    • Tag changed from activerecord associations, 3.0pre, activerecord, rails3 to activerecord associations, 3.0pre, activerecord, patch, rails3

    February 24th, 2010 @ 10:15 PM

  3. Will Bryant
    Will Bryant

    David, is this still an issue on master?

    May 26th, 2010 @ 05:17 AM

  4. David Genord II
    David Genord II

    Yes it is still an issue but the patch is going to change drastically. I should have it ready shortly.

    May 27th, 2010 @ 05:25 PM

  5. David Genord II
  6. Rohit Arondekar
    Rohit Arondekar
    • Tag changed from activerecord associations, 3.0pre, activerecord, patch, rails3 to 3.0pre, activerecord, associations, patch, rails3

    October 7th, 2010 @ 05:21 AM

  7. Jon Leighton
    Jon Leighton
    • Assigned user set to Aaron Patterson

    This is no longer an issue and so it can be closed.

    I've run both of David's tests and they work. It's already covered by test_eager_with_has_many_through_join_model_with_conditions_on_top_level in eager_test.rb.

    December 20th, 2010 @ 04:00 PM

  8. Jon Leighton
    Jon Leighton
    • State changed from new to resolved
    • Importance changed from to Low

    December 20th, 2010 @ 07:49 PM