YUKI Hiroshi
null+****@clear*****
Wed Dec 5 18:33:23 JST 2012
YUKI Hiroshi 2012-12-05 18:33:23 +0900 (Wed, 05 Dec 2012) New Revision: eafea2ea77448b88810220c7cc10334e606ba784 https://github.com/groonga/gcs/commit/eafea2ea77448b88810220c7cc10334e606ba784 Log: Set createdAt correctly Modified files: lib/database/index-field.js Modified: lib/database/index-field.js (+7 -1) =================================================================== --- lib/database/index-field.js 2012-12-05 18:24:31 +0900 (22b7287) +++ lib/database/index-field.js 2012-12-05 18:33:23 +0900 (a895cda) @@ -499,6 +499,9 @@ IndexField.prototype = { this._createdAt = value; return value; }, + get hasCreatedAt() { + return (typeof this.domain.getConfiguration(this.createdAtKey) != 'undefined'); + }, get createdAtKey() { return 'column_' + this.name + '_created_at'; }, @@ -517,6 +520,9 @@ IndexField.prototype = { this._updatedAt = value; return value; }, + get hasUpdatedAt() { + return (typeof this.domain.getConfiguration(this.updatedAtKey) != 'undefined'); + }, get updatedAtKey() { return 'column_' + this.name + '_updated_at'; }, @@ -576,7 +582,7 @@ IndexField.prototype = { }); var now = new Date(); - if (!this._createdAt) { + if (!this.hasCreatedAt) { this.updatedAt = this.createdAt = now; this.updateVersion = 1; } else { -------------- next part -------------- HTML����������������������������... Download