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.

Making ActiveRecord #merge_joins strip whitespace

#1297

In edge Rails the joins are nicely merged and duplicate join strings are uniq'ed out. However, if there is still some whitespace at the start and/or beginning, which is the case when hash-style joins are converted to string joins, they won't be an exact string match and will thus duplicates will not be removed and an ActiveRecord::InvalidStatement will most likely be raised.

Of course other things, such as database specific escaping, can still cause identical joins to not be an exact string match, however this patch will at least improve the chance of matches since it strips all joins of leading/trailing whitespaces.

Reported by FiXato · October 30th, 2008 @ 11:04 AM

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

Activity

  1. FiXato
    FiXato
    • Title changed from make ActiveRecord merge_joins strip whitespace to [PATCH] making ActiveRecord #merge_joins strip whitespace
    • Tag changed from 2.2, :joins, active, activerecord, merge_joins, scope to 2.2, :joins, active, activerecord, merge_joins, patch, scope

    October 31st, 2008 @ 08:59 AM

  2. Pratik
    Pratik
    • Milestone cleared.
    • Assigned user set to Pratik
    • Title changed from [PATCH] making ActiveRecord #merge_joins strip whitespace to Making ActiveRecord #merge_joins strip whitespace

    January 19th, 2009 @ 08:09 PM

  3. Repository
    Repository
    • State changed from new to resolved

    (from [a0d8202bb9fa55c328a3170836b0cddb40631e83]) Ensure whitespaces are stripped when merging string joins. [#1297 state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    January 28th, 2009 @ 08:01 PM