Signed-off-by: Clark Wang <clark.wangs@gmail.com>
remove undefined for creating data in findOrCreate
Signed-off-by: Clark Wang <clark.wangs@gmail.com>
getLastGeneratedUid instead of force an id
Signed-off-by: Clark Wang <clark.wangs@gmail.com>
This patch introduces a new API for "intent-based" hooks. These hooks
are not tied to a particular method (e.g. "find" or "update"). Instead,
they are triggered from all methods that execute a particular "intent".
The consumer API is very simple, there is a new method
Model.observe(name, observer), where the observer is function
observer(context, callback).
Observers are inherited by child models and it is possible to register
multiple observers for the same hook.
List of hooks:
- query
- before save
- after save
- after delete