fix issue with hasMany creating join tables
switch to lodash for deep clone