BUGFIX: now correctly finds related "has_ones" and puts ID into correct DB field