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.

default_scope with named_scope or scoped merge broken on 2.3

#2257

Failing tests included, don't have a solution ATM.

Reference: #2193

Basically, if you got a default_scope with :order, named_scopes with different :order will NOT override it.

Reported by Yaroslav Markin · March 16th, 2009 @ 06:59 PM

State: duplicate
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Geoff Buesing
    Geoff Buesing

    I'm noticing this broken behavior too. Haven't had a chance to look into the reasons why yet.

    March 18th, 2009 @ 09:20 PM

  2. Peter Wagenet
    Peter Wagenet

    It's expected behavior, believe it or not, look at the tests. Default_scope does not behave the same as named_scope. This should be fixed in my patch over here: http://rails.lighthouseapp.com/p...

    March 19th, 2009 @ 02:04 PM

  3. Yaroslav Markin
    Yaroslav Markin

    @Manfred, Pratik: any chance we can rollback #2193? Seems it causes more trouble then fixes things, count with named_scope(:select => ...) seems to be broken as well.

    March 23rd, 2009 @ 02:03 PM

  4. Manfred Stienstra
    Manfred Stienstra

    Well, the change was a fix for a number of regressions I saw in building instances through an has_many :through association I think. So reverting this would break that.

    March 23rd, 2009 @ 02:35 PM

  5. Alexander Podgorbunsky
    Alexander Podgorbunsky

    Manfred's commit has actually nothing to do with this bug -- see #1960

    March 26th, 2009 @ 01:07 PM

  6. Alexander Podgorbunsky
    Alexander Podgorbunsky

    whoops.. the wrong number of ticket.. see #2346

    March 26th, 2009 @ 01:09 PM

  7. Yaroslav Markin
    Yaroslav Markin

    This ticket is totally wrong, #2346 is the correct one. Will wait for cleanup :)

    April 15th, 2009 @ 10:03 PM

  8. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to duplicate

    May 1st, 2009 @ 11:03 PM