Skip to content

Commit e385e8e

Browse files
authored
Merge pull request #35 from fleetbase/dev-v0.1.17
v0.1.17
2 parents e5e3fd6 + fa29384 commit e385e8e

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

addon/models/customer.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ContactModel from './contact';
2-
import { attr } from '@ember-data/model';
2+
import { attr, hasMany } from '@ember-data/model';
33
import { computed } from '@ember/object';
44
import { equal } from '@ember/object/computed';
55
import { format as formatDate, isValid as isValidDate, formatDistanceToNow } from 'date-fns';
@@ -9,6 +9,9 @@ export default class CustomerModel extends ContactModel {
99
@attr('string') name;
1010
@attr('string') customer_type;
1111

12+
/** @relations */
13+
@hasMany('waypoint') waypoints;
14+
1215
/** @computed */
1316
@equal('customer_type', 'vendor') isVendor;
1417
@equal('customer_type', 'contact') isContact;

addon/models/waypoint.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default class WaypointModel extends PlaceModel {
66
/** @relationships */
77
@belongsTo('place', { async: false }) place;
88
@belongsTo('tracking-number', { async: false }) tracking_number;
9-
@belongsTo('customer', { polymorphic: true, async: false }) customer;
9+
@belongsTo('customer', { polymorphic: true, async: false, inverse: 'waypoints' }) customer;
1010

1111
/** @attributes */
1212
@attr('string') public_id;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fleetbase/fleetops-data",
3-
"version": "0.1.16",
3+
"version": "0.1.17",
44
"description": "Fleetbase Fleet-Ops based models, serializers, transforms, adapters and GeoJson utility functions.",
55
"keywords": [
66
"fleetbase-data",

0 commit comments

Comments
 (0)