Less queries by better eager loading. Fixes #508. The associations of some of the lineages were not in the cache, meaning they were queried for again resulting in lots of queries. The lineages for which this happened, were lineages that were present more than once. Only the first occurrence got the associations in their cache (due to a bug in rails?).
Less queries by better eager loading. Fixes #508.
The associations of some of the lineages were not in the cache, meaning they were queried for again resulting in lots of queries. The lineages for which this happened, were lineages that were present more than once. Only the first occurrence got the associations in their cache (due to a bug in rails?).

This fix forces to use the join based approach for eager loading instead of the default 1 query per association. BUT it only does this for the name association (this apparently is enough to work around the bug). We explicitly use the 1 query per association (preload) for the taxa, because otherwise we would get a query with a join of 27 tables and this is probably not a very good idea.

unipept/unipept,bmesuere/uni-test,bmesuere/uni-test,bmesuere/uni-test,unipept/unipept,bmesuere/uni-test,unipept/unipept,bmesuere/uni-test,unipept/unipept,unipept/unipept