MCPcopy Index your code
hub / github.com/dresende/node-orm2 / next

Function next

lib/Instance.js:226–251  ·  view source on GitHub ↗
(saved)

Source from the content-addressed store, hash-verified

224 var changes = {}, conditions = {}, i, prop;
225
226 var next = function (saved) {
227 var finish = function () {
228 saveInstanceExtra(cb);
229 }
230
231 if(!saved && !shouldSaveAssocs(saveOptions)) {
232 finish();
233 } else {
234 if (!shouldSaveAssocs(saveOptions)) {
235 runAfterSaveActions(function () {
236 finish();
237 }, false);
238 } else {
239 saveAssociations(function (err, assocSaved) {
240 if (saved || assocSaved) {
241 runAfterSaveActions(function () {
242 if (err) return cb(err);
243 finish();
244 }, false, err);
245 } else {
246 finish();
247 }
248 });
249 }
250 }
251 }
252
253 if (opts.changes.length === 0) {
254 next(false);

Callers 14

Express.jsFile · 0.70
Hook.jsFile · 0.70
Validators.jsFile · 0.70
nextHookFunction · 0.70
savePersistedFunction · 0.70
extendInstanceFunction · 0.50
runFunction · 0.50
extendInstanceFunction · 0.50
validation.jsFile · 0.50
hook.jsFile · 0.50

Calls 5

shouldSaveAssocsFunction · 0.85
finishFunction · 0.85
runAfterSaveActionsFunction · 0.85
saveAssociationsFunction · 0.85
cbFunction · 0.85

Tested by

no test coverage detected