null+****@clear*****
null+****@clear*****
2012年 8月 2日 (木) 11:46:54 JST
YUKI "Piro" Hiroshi 2012-08-02 11:46:54 +0900 (Thu, 02 Aug 2012) New Revision: 83418253c7dec5c3863817ff3af5791143f3bff2 https://github.com/groonga/gcs/commit/83418253c7dec5c3863817ff3af5791143f3bff2 Merged 66ecdb5: Merge branch 'master' of 192.168.1.26:/home/piro/gcs Log: Prepare method to create new domain ID Modified files: lib/database/domain.js Modified: lib/database/domain.js (+8 -5) =================================================================== --- lib/database/domain.js 2012-08-01 17:14:19 +0900 (ea8f50b) +++ lib/database/domain.js 2012-08-02 11:46:54 +0900 (f1fdb27) @@ -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; } @@ -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 + '_([^_]+)$'); @@ -114,7 +114,10 @@ Domain.prototype = { }, this)) return id; } - return this.id; + return this.createNewId(); + }, + createNewId: function() { + // we must calculate it! }, get tableName() { @@ -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; -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B... Descargar