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

Commit ae6f3bcb by Sascha Depold

added map on hash + manyToMany-name generation method

1 parent bfa9d65c
Showing with 12 additions and 0 deletions
...@@ -5,6 +5,10 @@ SequelizeHelper = { ...@@ -5,6 +5,10 @@ SequelizeHelper = {
}, },
SQL: { SQL: {
manyToManyTableName: function(t1, t2) {
return [t1.tableName, t2.tableName].sort().join("")
},
asTableIdentifier: function(name) { asTableIdentifier: function(name) {
return name.toLowerCase().replace(/s$/, "") + "Id" return name.toLowerCase().replace(/s$/, "") + "Id"
}, },
...@@ -97,6 +101,14 @@ SequelizeHelper = { ...@@ -97,6 +101,14 @@ SequelizeHelper = {
}) })
}, },
map: function(object, func) {
var result = []
SequelizeHelper.Hash.forEach(object, function(value, key, object) {
result.push(func(value, key, object))
})
return result
},
keys: function(object) { keys: function(object) {
var results = [] var results = []
for (var property in object) for (var property in object)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!