Added count_by_ref method on Task model