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

Commit 7aebecad by Mick Hansen

feat(associations): have association mixin calls (belongsTo/hasOne/hasMany) retu…

…rn the association instead of the model
1 parent 7e03745a
Showing with 4 additions and 3 deletions
......@@ -4,6 +4,7 @@ Notice: All 1.7.x changes are present in 2.0.x aswell
#### Breaking changes
- Sequelize now returns promises instead of its custom event emitter from most calls. This affects methods that return multiple values (like `findOrCreate` or `findOrInitialize`). If your current callbacks do not accept the 2nd success parameter you might be seeing an array as the first param. Either use `.spread()` for these methods or add another argument to your callback: `.success(instance)` -> `.success(instance, created)`.
- `.success()`/`.done()` and any other non promise methods are now deprecated (we will keep the codebase around for a few versions though). on('sql') persists for debugging purposes.
- Model association calls (belongsTo/hasOne/hasMany) are no longer chainable.
# v2.0.0-dev11
### Caution: This release contains many changes and is highly experimental
......
......@@ -94,7 +94,7 @@ Mixin.hasOne = function(associatedDAOFactory, options) {
association.injectSetter(this.DAO.prototype);
association.injectCreator(this.DAO.prototype);
return this
return association
}
/**
......@@ -133,7 +133,7 @@ Mixin.belongsTo = function(associatedDAOFactory, options) {
association.injectSetter(this.DAO.prototype)
association.injectCreator(this.DAO.prototype)
return this
return association
}
/**
......@@ -219,7 +219,7 @@ Mixin.hasMany = function(associatedDAOFactory, options) {
association.injectSetter(this.DAO.prototype)
association.injectCreator(this.DAO.prototype)
return this
return association
}
Mixin.getAssociation = function(target, alias) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!