MCPcopy Create free account
hub / github.com/dresende/node-orm2 / adjustForMapsTo

Function adjustForMapsTo

lib/Associations/Many.js:142–151  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

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 () {

Callers 1

extendInstanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected