Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'master' of 192.168.1.26:/home/piro/gcs
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Aug 2, 2012
2 parents 28770e5 + 8341825 commit 66ecdb5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
13 changes: 8 additions & 5 deletions lib/database/domain.js
Expand Up @@ -68,13 +68,13 @@ Domain.prototype = {
initializeNameAndId: function(source) {
if (typeof source == 'string') {
this.name = source;
this.id = this.getIdFromTable(this.toTableNamePart(this.name));
this.id = this.getIdForTable(this.toTableNamePart(this.name));
return;
}

if (source.query && source.query.DomainName) {
this.name = source.query.DomainName;
this.id = this.getIdFromTable(this.toTableNamePart(this.name));
this.id = this.getIdForTable(this.toTableNamePart(this.name));
return;
}

Expand All @@ -99,7 +99,7 @@ Domain.prototype = {

throw new Error('no domain name');
},
getIdFromTable: function(tableName) {
getIdForTable: function(tableName) {
if (this.context) {
var tables = this.context.tableListSync();
var tableIdMatcher = new RegExp('^' + tableName + '_([^_]+)$');
Expand All @@ -114,7 +114,10 @@ Domain.prototype = {
}, this))
return id;
}
return this.id;
return this.createNewId();
},
createNewId: function() {
// we must calculate it!
},

get tableName() {
Expand Down Expand Up @@ -160,7 +163,7 @@ Domain.prototype = {
},

get id() {
return this._id || DEFAULT_DOMAIN_ID;
return this._id === undefined ? DEFAULT_DOMAIN_ID : this._id ;
},
set id(value) {
return this._id = value;
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -18,12 +18,12 @@
},
"dependencies": {
"commander": "",
"nroonga": "",
"dateformat": "",
"express": "~ 2.5.10",
"jade": "",
"jsdeferred": "",
"mkdirp": "",
"jade": "",
"dateformat": "",
"nroonga": "",
"xml2js": "",
"xmlbuilder": ""
},
Expand Down

0 comments on commit 66ecdb5

Please sign in to comment.