| 140 | } |
| 141 | |
| 142 | function adjustForMapsTo(options) { |
| 143 | // Loop through the (cloned) association model id fields ... some of them may've been mapped to different |
| 144 | // names in the actual database - if so update to the mapped database column name |
| 145 | for(var i=0; i<options.__merge.to.field.length; i++) { |
| 146 | var idProp = association.model.properties[options.__merge.to.field[i]]; |
| 147 | if(idProp && idProp.mapsTo) { |
| 148 | options.__merge.to.field[i] = idProp.mapsTo; |
| 149 | } |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | Object.defineProperty(Instance, association.hasAccessor, { |
| 154 | value: function () { |