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 via http://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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to