@@ -7,7 +7,8 @@ var DataTypes = require('./data-types')
,inflection=require('inflection')
,_=require('lodash')
,dottie=require('dottie')
,uuid=require('node-uuid');
,uuid=require('node-uuid')
,deprecate=require('depd')('Utils');
varUtils=module.exports={
inflection:inflection,
...
...
@@ -394,24 +395,13 @@ var Utils = module.exports = {
},
formatReferences:function(obj){
varreferences={};
if(!obj||!_.isPlainObject(obj)||!obj.references){
returnobj;
}
if(_.isPlainObject(obj.references)){
references=obj.references;
}else{
references.model=obj.references;
}
if(obj.referencesKey){
references.key=obj.referencesKey;
deleteobj.referencesKey;
if(!_.isPlainObject(obj.references)){
deprecate('Non-object references property found. Support for that will be removed in version 4. Expected { references: { model: "value", key: "key" } } instead of { references: "value", referencesKey: "key" }.');