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

Commit f114ad3f by Sascha Depold

query interface on model

1 parent b95a0456
Showing with 4 additions and 4 deletions
......@@ -31,16 +31,16 @@ module.exports = (function() {
return this.__definition.QueryGenerator
})
Model.prototype.getQueryInterface = function() {
var sequelize = this.__definition.modelManager.sequelize
return this.queryInterface = this.queryInterface || new QueryInterface(sequelize)
}
Model.prototype.__defineGetter__('QueryInterface', function() {
return this.__definition.modelManager.QueryInterface
})
Model.prototype.save = function() {
var attr = this.__options.underscored ? 'updated_at' : 'updatedAt'
if(this.hasOwnProperty(attr))
this[attr] = new Date()
if(this.isNewRecord) {
var self = this
var eventEmitter = new Utils.CustomEventEmitter(function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!