Lighthouse has a new layout.
Prefer the old one? Return to the old layout,
and switch back any time from the link at the top of each page.
This project is archived and is in readonly mode.
Eager loading of has-many association does not respect :finder_sql
#412
class Firm < Company
has_many :clients_using_finder_sql, :class_name => "Client", :finder_sql => 'SELECT * FROM companies WHERE 1=1'
has_many :empty_clients_using_finder_sql, :class_name => "Client", :finder_sql => 'SELECT * FROM companies WHERE 1=0'
end
def test_preloading_when_using_finder_sql
firm = Firm.find(:first,:include => :empty_clients_using_finder_sql)
assert_equal(0,firm.empty_clients_using_finder_sql.size)
end