(assoc)
| 320 | |
| 321 | |
| 322 | var _saveManyAssociation = function (assoc) { |
| 323 | var assocVal = instance[assoc.name]; |
| 324 | |
| 325 | if (!Array.isArray(assocVal)) return; |
| 326 | if (!opts.associations[assoc.name].changed) return; |
| 327 | |
| 328 | for (j = 0; j < assocVal.length; j++) { |
| 329 | if (!assocVal[j].isInstance) { |
| 330 | assocVal[j] = new assoc.model(assocVal[j]); |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | saveAssociation(assoc.setAccessor, assocVal); |
| 335 | }; |
| 336 | |
| 337 | for (i = 0; i < opts.many_associations.length; i++) { |
| 338 | _saveManyAssociation(opts.many_associations[i]); |
no test coverage detected