Amendment - the last thing i posted didn't quite work - the rest of them
(ie which didn't have banana) weren't sorted as i had the logic a bit
screwed up. This is better: instead of this:
:order => "(tags.name = 'banana' or tags.name) desc"
do this:
:order => "(tags.name = 'banana') desc, tags.name"
Which is *now* effectively the same as yours (it wasn't before). :)
cheers! max
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment