Fixed join by model to allow expression to reference to hasMany field