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.

with_scope should accept and use order option

#2810

This patch adds support for order and nested orders when using with_scope.

Tests included, all tests passing on MySQL, Sqlite3 and Postgresql.

This will probably also close the following ticket:

https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets...

Reported by Emilio Tagua · June 16th, 2009 @ 11:56 PM

State: invalid
Milestone: 3.x
Assigned to: nobody
Importance: Low

Activity

  1. duncanbeevers
    duncanbeevers

    +1

    I think this fits best with people's expectations of how scopes should compose.

    September 17th, 2009 @ 11:48 PM

  2. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  3. Dan Pickett
    Dan Pickett
    • Tag changed from activerecord, patch, with_scope to activerecord, bugmash, patch, with_scope

    May 9th, 2010 @ 07:12 PM

  4. Jeff Kreeftmeijer
    Jeff Kreeftmeijer

    +1

    Applies cleanly to master and tests pass. Nice addition! :)

    May 15th, 2010 @ 05:26 PM

  5. Anil Wadghule
    Anil Wadghule

    I am trying to apply this patch with 'git am < patch.diff'. Patch is not getting applied for me http://pastie.org/961761. Am I missing something here?

    May 15th, 2010 @ 06:13 PM

  6. Enrico Bianco
    Enrico Bianco

    I'm having the same trouble applying this patch. The places where it fails don't even seem to be functional changes. Trying to edit the patch...

    May 15th, 2010 @ 07:01 PM

  7. Craig Krigsman
    Craig Krigsman

    I'm unable to apply this patch either.

    Base.rb 401 is a comment apply error.
    .rb wrong line apply location.

    Working on revised diff.

    Error output.

    error: patch failed: activerecord/lib/active_record/base.rb:401
    error: activerecord/lib/active_record/base.rb: patch does not apply
    error: patch failed: activerecord/test/cases/method_scoping_test.rb:657
    error: activerecord/test/cases/method_scoping_test.rb: patch does not apply

    May 15th, 2010 @ 07:09 PM

  8. Enrico Bianco
    Enrico Bianco

    Seems the with_scope method has changed considerably since this patch. Possibly some logic moved into arel that used to be in ActiveRecord::Base?

    May 15th, 2010 @ 07:14 PM

  9. Senthil
    Senthil

    I also got a very similar set of error while applying the patch http://gist.github.com/402327

    May 15th, 2010 @ 07:19 PM

  10. Rizwan Reza
    Rizwan Reza
    • Tag changed from activerecord, bugmash, patch, with_scope to activerecord, patch, with_scope
    • State changed from new to invalid

    I am closing it. We can reopen if the issue still exists.

    May 15th, 2010 @ 07:40 PM

  11. Craig Krigsman
    Craig Krigsman
    • Tag changed from activerecord, patch, with_scope to activerecord, bugmash, patch, with_scope

    -1 I would suggest this patch is no longer relevant to rails 3 since with_scope has been removed. http://m.onkey.org/2010/1/22/active-record-query-interface

    May 15th, 2010 @ 07:53 PM

  12. Ryan Bigg
    Ryan Bigg
    • Tag cleared.
    • Importance changed from to Low

    Automatic cleanup of spam.

    November 8th, 2010 @ 01:54 AM