loopback-datasource-juggler/lib
Miroslav Bajtoš f1fa976f50
Fix coercion of PK value in `replaceById` method
Before this change, when both the PK value (`id`) and the `data` object
were provided as plain-data values (e.g. as received in a JSON request),
and the connector was using a complex PK type (e.g. `ObjectID`
in MongoDB), then `replaceById` operation was printing confusing
warnings:

    WARNING: id property cannot be changed from 5d39775a59f5f541513c5e05
        to 5d39775a59f5f541513c5e05 for model:Post
        in 'before save' operation hook

    WARNING: id property cannot be changed from 5d39775a59f5f541513c5e05
        to 5d39775a59f5f541513c5e05 for model:Post
        in 'loaded' operation hook

This commit fixes the problem by applying the same type coercion on the
PK value (`id`) as has been applied by the model constructor on the PK
property (`data.id`).

Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
2019-07-26 09:02:52 +02:00
..
connectors chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
kvao chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
browser.depd.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
dao.js Fix coercion of PK value in `replaceById` method 2019-07-26 09:02:52 +02:00
datasource.js Fix autoupdate queueing automigrate instead (#1762) 2019-07-25 14:17:34 -04:00
date-string.js Fix DateString ctor to accept DateString instances 2019-05-13 15:21:00 +02:00
geo.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
hooks.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
include.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
include_utils.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
introspection.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
jutil.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
list.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
mixins.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
model-builder.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
model-definition.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
model-utils.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
model.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
observer.js feat: after operation hook in case of errors 2019-05-31 17:12:42 +02:00
relation-definition.js Fix for #1724 - Added options to attribute updates (#1725) 2019-05-27 09:49:46 -04:00
relations.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
scope.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
transaction.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
types.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
utils.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
validations.js chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00