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

Commit d7ea69af by Sascha Depold

cleaner object extension

1 parent 45fbddcf
Showing with 7 additions and 6 deletions
......@@ -9,6 +9,9 @@ module.exports = (function() {
connector: 'mysql',
host: 'localhost',
port: 3306,
define: {},
query: {},
sync: {}
}, options || {})
this.config = {
......@@ -45,12 +48,10 @@ module.exports = (function() {
}
Sequelize.prototype.query = function(sql, callee, options) {
options = options || {}
if(this.options.query)
options = Sequelize.Utils.merge(options, this.options.query)
options.logging = this.options.hasOwnProperty('logging') ? this.options.logging : true
options = Utils._.extend(Utils._.clone(this.options.query), options || {})
options = Utils._.extend(options, {
logging: this.options.hasOwnProperty('logging') ? this.options.logging : true
})
return this.connectorManager.query(sql, callee, options)
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!