I am trying to upgrade existing Rails codebase from Rails 1.2.5 to
Rails 2.0.2. My db is mysql.
I ran into a "table not found" error after upgrading in one of the
cases which works perfectly under 1.2.5.
So this assert statement gives the following error :
:joins => "as qq inner join qcis as qc on qq.qci_id = qc.id ",
:conditions => [ "qc.unit_id = ?", 1]).size, "Wrong number of
resident interview questions loaded.")
basically AR isn't expecting you to alias the main table you're
querying (and short of being able to parse the joins statement, how
Wild speculation, but i suspect the reason it does this is because
previously you'd very commonly do
Foo.find :all, :joins => '...'
and then you spend 5 minutes scratching your head because weird stuff
is happening because the id column from foos is getting squashed by
the id column for this join tables. so you add :select => 'foos.*' to
the thing. The change means that in the 95% of cases where you where
just systematically adding on :select => 'foos.*' you don't have to.