backbone-relations
Advanced tools
Comparing version 0.4.4 to 0.4.5
@@ -19,2 +19,7 @@ (function () { | ||
this.key = key; | ||
if (this.via) { | ||
var split = this.via.split('#'); | ||
this.via = split[0]; | ||
this.viaKey = split[1] || key; | ||
} | ||
}; | ||
@@ -29,4 +34,3 @@ | ||
if (!this.via) return this.get(); | ||
var split = this.via.split('#'); | ||
var models = this.owner.resolve(split[0]).pluck(split[1] || this.key); | ||
var models = this.owner.resolve(this.via).pluck(this.viaKey); | ||
return new this.hasMany( | ||
@@ -86,3 +90,3 @@ models[0] instanceof this.hasMany ? | ||
if (this.via) { | ||
instance.via = owner.get(this.via.split('#')[0]); | ||
instance.via = owner.get(this.via); | ||
} else if (reverse) { | ||
@@ -89,0 +93,0 @@ instance.on('add', function (model, __, options) { |
{ | ||
"name": "backbone-relations", | ||
"version": "0.4.4", | ||
"version": "0.4.5", | ||
"author": "Casey Foster <c@sey.me>", | ||
@@ -5,0 +5,0 @@ "licence": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6515
131