From 23cf373432ed2f99da809f996b66445bc1ef4c1d Mon Sep 17 00:00:00 2001 From: Raymond Feng <raymond@strongloop.com> Date: Fri, 22 Nov 2013 09:09:02 -0800 Subject: [PATCH] Allow app.id to be set --- lib/models/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/application.js b/lib/models/application.js index 646e2897..8e71fe5f 100644 --- a/lib/models/application.js +++ b/lib/models/application.js @@ -100,7 +100,7 @@ var Application = loopback.createModel('Application', ApplicationSchema); Application.beforeCreate = function (next) { var app = this; app.created = app.modified = new Date(); - app.id = generateKey('id', 'sha1'); + app.id = app.id || generateKey('id', 'sha1'); app.clientKey = generateKey('client'); app.javaScriptKey = generateKey('javaScript'); app.restApiKey = generateKey('restApi');