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

Commit cb5bb42d by Sascha Depold

correctly extend default options

1 parent 74ae10c2
...@@ -7,7 +7,13 @@ module.exports = (function() { ...@@ -7,7 +7,13 @@ module.exports = (function() {
var self = this var self = this
this.options = Utils._.extend({ this.options = Utils._.extend({
timestamps: true timestamps: true,
instanceMethods: undefined,
classMethods: undefined,
validate: undefined,
freezeTableName: false,
underscored: false,
paranoid: false
}, options || {}) }, options || {})
this.name = name this.name = name
......
...@@ -9,7 +9,12 @@ module.exports = (function() { ...@@ -9,7 +9,12 @@ module.exports = (function() {
this.__definition = null // will be set in Model.build this.__definition = null // will be set in Model.build
this.attributes = [] this.attributes = []
this.validators = {} // holds validation settings for each attribute this.validators = {} // holds validation settings for each attribute
this.__options = options || {} this.__options = Utils._.extend({
underscored: false,
hasPrimaryKeys: false,
timestamps: true,
paranoid: false
}, options || {})
initAttributes.call(this, values) initAttributes.call(this, values)
} }
......
...@@ -6,7 +6,10 @@ module.exports = (function() { ...@@ -6,7 +6,10 @@ module.exports = (function() {
this.client = client this.client = client
this.callee = callee this.callee = callee
this.options = options || {} this.options = Utils._.extend({
logging: true,
plain: false
}, options || {})
this.bindClientFunction = function(err) { onFailure.call(self, err) } this.bindClientFunction = function(err) { onFailure.call(self, err) }
} }
Utils.addEventEmitter(Query) Utils.addEventEmitter(Query)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!