Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow end-user devs to set ids on items explicitly.

  • Loading branch information...
commit 94306222efa6f94249374512d47279f1b166ae25 1 parent a9ca0f9
@mde mde authored
View
4 geddy-model/lib/adapters/couchdb.js
@@ -67,10 +67,10 @@ var adapter = new function () {
// Create track
else {
// Responsibilities of the adapter include:
- // 1. Setting the UUID on the item
+ // 1. Setting the UUID on the item if there's not one already explicitly set
// 2. setting the saved flag before saving
uuid = geddy.util.string.uuid();
- modelItem.id = uuid;
+ modelItem.id = modelItem.id || uuid;
modelItem.saved = true;
}
View
4 geddy-model/lib/adapters/sql_base.js
@@ -52,10 +52,10 @@ var SQLBaseAdapter = function (conn) {
// Create track
else {
// Responsibilities of the adapter include:
- // 1. Setting the UUID on the item
+ // 1. Setting the UUID on the item if there's not one already explicitly set
// 2. setting the saved flag before saving
uuid = geddy.util.string.uuid();
- modelItem.id = uuid;
+ modelItem.id = modelItem.id || uuid;
modelItem.saved = true;
// Serialize item after setting saved flag
Please sign in to comment.
Something went wrong with that request. Please try again.