On Nov 11, 3:07 am, Jeff Pritchard <rails-mailing-l...@andreas-s.net>
wrote:
> If the class that we apply acts_as_rated to ("images" in my case) winds
> up with a
> has_one :rating_statistic
>
> and the rating_statistics model
> belongs_to :image
>
> and "rating_avg" is a member of the statistics table...
>
> What would the join look like to :order  by :rating_avg ?
>
Well unless you care particularly about what the join looks like you
can just add :joins => rating_statistic to your find. Do take the time
to familiarize yourself with this sort of stuff though or it will bite
you on the ass eventually.

Fred
> thanks,
> jp
> --
> 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