quick
quick copied to clipboard
fresh/refresh don't update subselect
I've got a scope like
function scopeWithFoo( qb ) {
return qb.addSubselect("foo", newEntity("someEntity").select("foo").whereSomething());
}
later we use the scope, but calling fresh/refresh doesn't update foo
:
var base = getInstance("theModel").withFoo().firstOrFail();
// ... do things that update the foo value indirectly
var refreshedBase = base.fresh();
// does not reflect the change
refreshedBase.getFoo();
// does not reflect the change
base.refresh().getFoo();
// can see the change like this
getInstance("theModel").withFoo().whereTheModelID(base.getID()).getFoo();
thanks!