Merge pull request #190 from strongloop/feature/handle-connector-without-types

datasource: support connectors without `getTypes`
This commit is contained in:
Miroslav Bajtoš 2014-07-25 17:33:01 +02:00
commit 27add4ce0b
1 changed files with 2 additions and 1 deletions

View File

@ -647,7 +647,8 @@ DataSource.prototype.getModelDefinition = function (name) {
* ['rest'], or ['db', 'rdbms', 'mysql']
*/
DataSource.prototype.getTypes = function () {
var types = this.connector && this.connector.getTypes() || [];
var getTypes = this.connector && this.connector.getTypes;
var types = getTypes && getTypes() || [];
if (typeof types === 'string') {
types = types.split(/[\s,\/]+/);
}