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

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() { ...@@ -9,6 +9,9 @@ module.exports = (function() {
connector: 'mysql', connector: 'mysql',
host: 'localhost', host: 'localhost',
port: 3306, port: 3306,
define: {},
query: {},
sync: {}
}, options || {}) }, options || {})
this.config = { this.config = {
...@@ -45,12 +48,10 @@ module.exports = (function() { ...@@ -45,12 +48,10 @@ module.exports = (function() {
} }
Sequelize.prototype.query = function(sql, callee, options) { Sequelize.prototype.query = function(sql, callee, options) {
options = options || {} options = Utils._.extend(Utils._.clone(this.options.query), options || {})
options = Utils._.extend(options, {
if(this.options.query) logging: this.options.hasOwnProperty('logging') ? this.options.logging : true
options = Sequelize.Utils.merge(options, this.options.query) })
options.logging = this.options.hasOwnProperty('logging') ? this.options.logging : true
return this.connectorManager.query(sql, callee, options) 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!