不要怂,就是干,撸起袖子干!

Commit 94ce9588 by Jonathan Crossman

- changed error message to match expected test result

- coding style
- support both definition styles
1 parent db76b114
Showing with 9 additions and 3 deletions
...@@ -151,9 +151,15 @@ module.exports = (function() { ...@@ -151,9 +151,15 @@ module.exports = (function() {
options = options || {} options = options || {}
var globalOptions = this.options var globalOptions = this.options
for (var name in attributes){ for (var name in attributes) {
if (attributes[name].type === undefined){ if (attributes.hasOwnProperty(name)) {
throw new Error(daoName + '.' + name + ' data type is undefined.'); var dataType = attributes[name]
if (Utils.isHash(dataType)) {
dataType = dataType.type
}
if (dataType === undefined) {
throw new Error('Unrecognized data type for field '+ name)
}
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!