fix activerecord relation bug in group solver