Implement generator for #group_by