Re: silent scope ?

Gavin
2009-09-19T09:10:41Z

Bingo Bob,

Just tried this out on my own machine.

Works fine for me.

What version of ActiveRecord are you using?

On Sep 19, 7:31 am, bingo bob
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
> I do this in my model.
>
>   named_scope :popular, :order => ''name'', :conditions
=>
> [''popular_resort = ?'', true]
>   default_scope :order => ''resort_height DESC, name''
>
> By default my resorts are sorted by resort_height then name - works
> fine.
>
> Then when I do this Resort.popular I wish to override the sort order
>
> I want my popular resorts sorted by name NOT altitude
>
> It does not work? Resort.popular does this..
>
> SELECT * FROM "resorts" WHERE (popular_resort =
''t'') ORDER BY
> resort_height DESC, name
>
> i.e. it''s still doing the ORDER BY resort_height DESC bit which I
don''t
> want.
>
> What am I missing here?