Bind db handle to fn variable

During the conversion to typescript, the behaviour of the database
handle changed slightly, meaning storing a reference to the models
function also requires a bind to be applied too.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@resin.io>
This commit is contained in:
Cameron Diver 2018-06-28 14:25:06 +01:00
parent 857165f625
commit 080fdd3774
No known key found for this signature in database
GPG Key ID: 69264F9C923F55C1

View File

@ -61,7 +61,7 @@ module.exports = class DeviceConfig
return @configBackend
setTarget: (target, trx) =>
db = trx ? @db.models
db = trx ? @db.models.bind(@db)
confToUpdate = {
targetValues: JSON.stringify(target)
}