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

Commit 14ca4e6e by Sascha Depold

mysql is working :)

1 parent 4281e799
...@@ -143,23 +143,16 @@ module.exports = (function() { ...@@ -143,23 +143,16 @@ module.exports = (function() {
var hasJoin = false var hasJoin = false
var options = Utils._.clone(options) var options = Utils._.clone(options)
if ((typeof options === 'object') && (options.hasOwnProperty('include'))) { if (typeof options === 'object') {
var includes = options.include hasJoin = true
hasJoin = true if (options.hasOwnProperty('include')) {
options.include = {} hasJoin = true
/*options.include =*/ includes.map(function(include) {
console.log(include instanceof DAOFactory)
})
includes.forEach(function(daoName) {
options.include[daoName] = this.daoFactoryManager.getDAO(daoName)
if (!options.include[daoName]) { options.include = options.include.map(function(include) {
options.include[daoName] = this.getAssociationByAlias(daoName).target return validateIncludedElement.call(this, include)
} }.bind(this))
}.bind(this)) }
// whereCollection is used for non-primary key updates // whereCollection is used for non-primary key updates
this.options.whereCollection = options.where || null this.options.whereCollection = options.where || null
......
...@@ -198,6 +198,8 @@ module.exports = (function() { ...@@ -198,6 +198,8 @@ module.exports = (function() {
} }
QueryInterface.prototype.select = function(factory, tableName, options, queryOptions) { QueryInterface.prototype.select = function(factory, tableName, options, queryOptions) {
options = options || {}
var sql = this.QueryGenerator.selectQuery(tableName, options) var sql = this.QueryGenerator.selectQuery(tableName, options)
queryOptions = Utils._.extend({}, queryOptions, { include: options.include }) queryOptions = Utils._.extend({}, queryOptions, { include: options.include })
return queryAndEmit.call(this, [sql, factory, queryOptions], 'select') return queryAndEmit.call(this, [sql, factory, queryOptions], 'select')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!