Strange sql being generated

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 = AND
contents.type = “Spotcomment”’, :group => ‘contents.parent_id’, :order
=> “avg(contents.rating)”)

(I welcome any more efficient ways of doing this!)

the :limit parameter seems to add a WHERE 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



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs