Displaying 1 result from an estimated 1 matches for "trait_id".
Did you mean:
bait_id
2009 Feb 15
3
conditions on association include, hacky but more or less solved
...factor not loaded here
and for Marco I''d want
Height.Short
Height.Medium
Height.Tall
HairColor.Red
HairColor.Brown
HairColor.Black
In SQL this would be represented by a condition in the join clause:
...
FROM `traits`
LEFT OUTER JOIN `trait_values` ON trait_values.trait_id = traits.id
LEFT OUTER JOIN `key_factors` ON key_factors.trait_value_id =
trait_values.id
AND
key_factors.entity_id=@entity.id
There are two steps to getting this effect. First, you have to get the
associations to load in a single query....