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

strongloop / loopback-next / 15917
76%

Build:
DEFAULT BRANCH: master
Ran 24 Feb 2020 07:02PM UTC
Jobs 1
Files 452
Run time 1min
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

pending completion
15917

push

travis-ci-com

raymondfeng
feat(repository): make `targetsMany` property required

Modify `RelationDefinitionBase` to require all relation definitions
to provide value of `targetsMany` field.

BREAKING CHANGE: If you are building a custom relation type with its
own definition interface, make sure the interface includes `targetsMany`
property. Typically, the type of this property is hard-coded as `true`
or `false`, depending on the relation type.

```ts
interface HasManyDefinition extends RelationDefinitionBase {
  type: RelationType.hasMany;
  targetsMany: true;
  // etc.
}

export interface BelongsToDefinition extends RelationDefinitionBase {
  type: RelationType.belongsTo;
  targetsMany: false;
  // etc.
}
```

When creating an instance of a relation definition, make sure to include
a value for `targetsMany` property.

```ts
new ModelDefinition('Order')
  .addRelation({
    name: 'customer',
    type: RelationType.belongsTo,
    targetsMany: false,
    source: Order,
    target: () => Customer,
    keyFrom: 'customerId',
    keyTo: 'id',
  });
```

Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>

4336 of 5015 branches covered (86.46%)

Branch coverage included in aggregate %.

11222 of 11796 relevant lines covered (95.13%)

947.38 hits per line

Jobs
ID Job ID Ran Files Coverage
1 15917.1 (TASK=test) 24 Feb 2020 07:02PM UTC 0
92.55
Travis Job 15917.1
Source Files on build 15917
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #15917
  • cd4d43ab on github
  • Prev Build on master (#15910)
  • Next Build on master (#15920)
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