Fix the regression introduced by 9af79cf51a where updateAttributes
and replaceAttributes was incorrectly handling the response returned
by the database.
This commit restores the old behaviour where `context.data` is updated
only by a connector-provided function and reverts an incorrect change
of a test file made as part of the faulty fix.
Besides the fixes, this patch also renames `data` to `dbResponse` and
add comments explaining the structure of the response object for more
clarity.
Before this change, many Operation Hooks were not correctly propagating
changes made to `ctx.data` via reassigning ctx.data to a new object.
This change modifies existing tests to account for this different
scenario, adds few more tests for scenarios that were not covered by
tests before and finally fixes the problem discovered.
Differentiate between tests skipped by feature flags, and those
manually marked as skipped.
Tests that use the bdd.describe and bdd.it helper functions
will be marked as [UNSUPPORTED] if they are conditionally disabled.
create() triggers
- before save
- after save
udpate() triggers
- before save
- after save
destroy() triggers
- before delete
- after delete
The implementation here is intentionally left with less features
than the regular DAO methods provide, the goal is to get a partial
(but still useful!) version released soon.
"before save" hooks provide "ctx.isNewInstance" whenever "ctx.instance"
is set. Possible values:
- true for all CREATE operations
- false for all UPDATE operations
- undefined for "prototype.save"
"after save" hooks provide "ctx.isNewInstance" whenever "ctx.instance"
is set. Possible values:
- true after all CREATE operations
- false after all UPDATE operations
- undefined after "updateOrCreate" and "save"
Note: both "updateOrCreate" and "prototype.updateAttributes"
don't provide `ctx.instance` to "before save" hooks, therefore
`ctx.isNewInstance` it not provided either.