Hello all,
I''ve got a class method, as follows -
def self.highest_rated(count)
Spotguide.find(:all, :limit => 3, :include => :spotcomments, :joins
=> ''INNER JOIN contents on contents.parent_id = spotguides.id AND
contents.type = "Spotcomment"'', :group =>
''contents.parent_id'', :order
=> "avg(contents.rating)")
end
(I welcome any more efficient ways of doing this!)
the :limit parameter seems to add a WHERE spotguides.id IN
(''4'') to the
generated sql string rather than adding LIMIT 3 at the end.
Does anyone have any ideas what might be going on here? I''m using RC2
of rails 1.2
Cheers,
Alastair
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---