At first I posted this in rubyonrails-talk, but no one there was able to tell me if this is a bug or not (I got only suggestion for workaround).
As this looks like 3.1 regression that breaks existing 3.0.10 code I decided to post this here in addition.
I’ve upgraded to Rails 3.1 (from 3.0.10), ran my test suite and found this issue:
class Trade < ActiveRecord::Base
Earlier this used to work perfectly, now I get this:
What puzzles me is that no LEFT OUTER JOIN on transaction_trades is
present in generated SQL - that’s why things broke.
And it was there in 3.0.10, so table got joined and this code was perfectly working.
Any hints what’s wrong here? Why is :include => :transaction_trades seems to be ignored?