YUKI Hiroshi
null+****@clear*****
Mon Aug 27 16:38:48 JST 2012
YUKI Hiroshi 2012-08-27 16:38:48 +0900 (Mon, 27 Aug 2012) New Revision: bc645ef45f0cea9f6417076aec76f456642e0343 https://github.com/groonga/gcs/commit/bc645ef45f0cea9f6417076aec76f456642e0343 Log: Check field existence before updating default search field Modified files: bin/gcs-configure-default-search-field test/gcs-commands.test.js Modified: bin/gcs-configure-default-search-field (+1 -1) =================================================================== --- bin/gcs-configure-default-search-field 2012-08-27 16:35:59 +0900 (42b9569) +++ bin/gcs-configure-default-search-field 2012-08-27 16:38:48 +0900 (f12be1c) @@ -18,7 +18,7 @@ commandLine.assertHaveDomainName(); commandLine.assertDomainExists(); var field = commandLine.domain.getIndexField(commandLine.options.name); -if (field) { +if (field && field.exists()) { console.log('Setting "%s" as the default search field of "%s"...', field.name, commandLine.domain.name); Modified: test/gcs-commands.test.js (+1 -1) =================================================================== --- test/gcs-commands.test.js 2012-08-27 16:35:59 +0900 (a25f653) +++ test/gcs-commands.test.js 2012-08-27 16:38:48 +0900 (96ce1fd) @@ -747,7 +747,7 @@ suite('gcs-configure-default-search-field', function() { assert.deepEqual({ code: result.code, message: result.output.stdout }, { code: 1, - message: '"name" as not a field of "companies".\n' }, + message: '"address" is not a field of "companies".\n' }, result.output.stderr); assert.equal(domain.defaultSearchField.name, 'name'); done(); -------------- next part -------------- HTML����������������������������...Download