Forum: Ruby on Rails dynamic finder > popularity

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Remco S. (Guest)
on 2008-11-11 10:44
Hi,

i have popularity table wich has a relationship with the
bookings-destinations. Some destinations are booked more then others.

The popularity table has the columns "primary-key" and a score.

Example

| TVC           |            6 |
| AZO           |            4 |
| TUO           |            3 |
| IVC           |            1 |
| VKO           |            1 |
| DMM           |            1 |


Qeustion: how can i use a dynamic finder...with the purpose "show me the
the top 20 popularity destinations"

Grtz..remco
Andrew C. (Guest)
on 2008-11-11 14:29
So a

Destination.find(:all, :limit => 20, :order => 'popularity desc' )

is no good?
This topic is locked and can not be replied to.