Skip to content

Commit

Permalink
fixed a small bug when saving data with a forced identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierlacot committed Mar 15, 2012
1 parent 3cd90e7 commit 8d9958f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions joli.js
Expand Up @@ -152,7 +152,7 @@ joli.Connection = function(database) {

joli.Connection.prototype = {
execute: function(query) {
// Titanium.API.log('debug', query);
// Titanium.API.log('info', query);
return this.database.execute(query);
},
lastInsertRowId: function() {
Expand Down Expand Up @@ -763,7 +763,11 @@ joli.record.prototype = {
data.originalData = this._originalData;
this._options.table.save(data);
} else if (this.isNew()) {
this._data.id = this._options.table.save(data);
var rowid = this._options.table.save(data);

if (!data.id) {
this._data.id = rowid;
}
}

// overwrite original data so it is no longer "dirty" OR so it is no
Expand Down

0 comments on commit 8d9958f

Please sign in to comment.