I mistook.
try `where("teams.id" => team.id)`