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

Commit c77e298a by Jan Aagaard Meier Committed by Mick Hansen

fix(btm): Expose belongs to many getter similar to other associations (#6551)

1 parent 32b51c4a
Showing with 9 additions and 5 deletions
......@@ -428,13 +428,10 @@ BelongsToMany.prototype.injectAttributes = function() {
return this;
};
BelongsToMany.prototype.injectGetter = function(obj) {
var association = this;
obj[this.accessors.get] = function(options) {
BelongsToMany.prototype.get = function(instance, options) {
options = Utils.cloneDeep(options) || {};
var instance = this
var association = this
, through = association.through
, scopeWhere
, throughWhere;
......@@ -488,6 +485,13 @@ BelongsToMany.prototype.injectGetter = function(obj) {
}
return model.findAll(options);
};
BelongsToMany.prototype.injectGetter = function(obj) {
var association = this;
obj[this.accessors.get] = function(options) {
return association.get(this, options);
};
obj[this.accessors.count] = function(options) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!