[Compatibility] Store reference instead of binding

This commit is contained in:
Pete Richards 2015-08-06 16:55:15 -07:00
parent b0a23590d4
commit 058a0d393d

View File

@ -14,16 +14,17 @@ define(
* primary location. Returns a promise. * primary location. Returns a promise.
*/ */
LocationCapability.prototype.persistLocation = function () { LocationCapability.prototype.persistLocation = function () {
var capability = this;
return this.domainObject.useCapability( return this.domainObject.useCapability(
'mutation', 'mutation',
function (model) { function (model) {
model.location = this.getLocation(); model.location = capability.getLocation();
}.bind(this) }
).then(function () { ).then(function () {
return this.domainObject return capability.domainObject
.getCapability('persistence') .getCapability('persistence')
.persist(); .persist();
}.bind(this)); });
}; };
/** /**