Railsters:
Our design is just one refactor away from attaining Nirvana (and deleting a _lot_ of code!). Only this bug stands between us and enlightenment:
http://dev.rubyonrails.org/ticket/6415
Here's a synopsis:
Frog.find( :all, :include => { :species => ['clade'] }, :conditions => ['clade_id in (?)', 1], :limit => 12 )
That produces this:
ActiveRecord::StatementInvalid: Mysql::Error: Unknown column 'clade_id' in 'where clause': SELECT id FROM frogs WHERE (clade_id in (1)) LIMIT 12
That SELECT is clearly missing most of its details, including niceties like frogs.* for the result columns.
Without the :limit, it works fine (so I don't think that :offset is implicated, like the ticket says).
I'm going into ActiveRecord to monkey patch this. Has anyone tried yet?