fix(hasMany): fix foreign key naming issue with N:M (closes #1685)