• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

strongloop / loopback-datasource-juggler / 5368 / 2
85%
master: 85%

Build:
Build:
LAST BUILD BRANCH: fix-deprecated-pkgs
DEFAULT BRANCH: master
Ran 26 Jul 2019 07:04AM UTC
Files 36
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Jul 2019 07:02AM UTC coverage: 84.595% (+0.02%) from 84.573%
5368.2

push

travis-ci

bajtos
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>

4491 of 5608 branches covered (80.08%)

Branch coverage included in aggregate %.

7090 of 8082 relevant lines covered (87.73%)

926.67 hits per line

Source Files on job 5368.2
  • Tree
  • List 0
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 5193
  • Travis Job 5368.2
  • f1fa976f on github
  • Prev Job for on fix/PK-coercion-in-replaceById (#5366.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc