avoid joins in rails4 when calculating maximum updated_at if they are not needed