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
2.14.0
* Remove console.log (Raymond Feng)
* Fix for #369 (Dallon Feldner)
* Fix virtual id get function. (Berkeley Martinez)
* Fix Model.prototype.inspect (Miroslav Bajtoš)
* Include property value in the error message (Miroslav Bajtoš)
* Update datasource.js (Rand McKinney)
* Change Model to BaseModel for clarity (Fabien Franzen)
* Don't coerce nested objects into Model instances (Fabien Franzen)
Return the raw object data when running on Node v0.11.14+
That way all `inspect` options are always preserved.
When running on older version:
- Honour the depth argument passed to the custom `inspect` function.
- Disable color output, becase there is now way how to detect whether
colors were enabled or disabled by the top-level caller.
When building a list of errors for `ValidationError.message`, include
the values of invalid properties too.
In order to keep the message reasonably short, the values are truncated
at approx 32 characters.
For queries, this is undesirable. It also affects
loopback-connector-mongodb's ability to perform nested queries (it
expects plain objects to work correctly, and to allow $elemMatch for
example).
2.13.0
* added test for sorting undefined values (Christian Vette)
* Fix the floating number comparison (Raymond Feng)
* Fix bad CLA URL in CONTRIBUTING.md (Ryan Graham)
* replace deprecated function __defineGetter__ (bitmage)
* add a flag to callback of findOrCreate to indicate find or create (Clark Wang)
* fix sorting of undefined values with multiple columns (Christian Vette)
* code style (cvette)
* fix sorting with undefined in memory connector (cvette)
* Added support for inline parameters like: new GeoPoint(-34, 150) (Simo Moujami)
* fix default include in default scope fails findById (Clark Wang)
* Added test for toString() (Simo Moujami)
* Additional formatting (Simo Moujami)
* Fixed constructor parameters and added bdd tests for constructor validation (Simo Moujami)
* Fixed indentation (Simo Moujami)
* Added mocha tests for GeoPoint (Simo Moujami)
* renamed intermediary variable (Simo Moujami)
* Fixed the haversine formula to calculate distance between 2 points properly (Simo Moujami)