From 41d71c5a5b6349caafe0f1cbde70fe5ac6a9a8f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 28 Apr 2016 13:23:50 +0200 Subject: [PATCH] RELEASE-NOTES: describe 30283291 Add an entry for a breaking change made in 30283291 that was not described previously. --- 3.0-RELEASE-NOTES.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/3.0-RELEASE-NOTES.md b/3.0-RELEASE-NOTES.md index c8a5ed89..180d702c 100644 --- a/3.0-RELEASE-NOTES.md +++ b/3.0-RELEASE-NOTES.md @@ -18,4 +18,19 @@ via `global.Promise`, you will have to check all places where you are using non-standard promise API and update them to use Bluebird API instead. -Please see [Related code change](https://github.com/strongloop/loopback-datasource-juggler/pull/790) here. \ No newline at end of file +Please see [Related code change](https://github.com/strongloop/loopback-datasource-juggler/pull/790) here. + +## DAO.find provides ctx.data in "loaded" hook + +When implementing "loaded" hook for `DAO.find` method, we have mistakenly +implemented a version that sets `ctx.instance` instead of `ctx.data`. This +defeats the purpose of the "loaded" hook, which is to allow hooks to modify +the raw data provided by the datasource before it's used to build a model +instance. + +This has been fixed in 3.0 and the "loaded" hook now consistently provides +`ctx.data` for all operations. If you have a "loaded" hook handler that +checks `if (ctx.instance)` then you can remove this condition together with +the branch that follows. + +See also the commit [30283291](https://github.com/strongloop/loopback-datasource-juggler/commit/30283291?w=1)