1 | import { get } from '@ember/object';
|
2 |
|
3 | /**
|
4 | @module @ember-data/serializer
|
5 | */
|
6 |
|
7 | /*
|
8 | Check if the passed model has a `type` attribute or a relationship named `type`.
|
9 |
|
10 | @method modelHasAttributeOrRelationshipNamedType
|
11 | @param modelClass
|
12 | */
|
13 | function modelHasAttributeOrRelationshipNamedType(modelClass) {
|
14 | return get(modelClass, 'attributes').has('type') || get(modelClass, 'relationshipsByName').has('type');
|
15 | }
|
16 |
|
17 | export { modelHasAttributeOrRelationshipNamedType };
|