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...@andreas-s.net>
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?
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to