You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: packages/model/src/-private/debug/assert-polymorphic-type.ts
+11
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,17 @@ if (DEBUG) {
116
116
assert(assertionMessage,isPolymorphic);
117
117
}
118
118
}
119
+
120
+
if(meta){
121
+
assert(
122
+
`Expected the schema for the field ${parentDefinition.inverseKey} on ${addedIdentifier.type} to be for a legacy relationship`,
123
+
meta.kind==='belongsTo'||meta.kind==='hasMany'
124
+
);
125
+
assert(
126
+
`The schema for the relationship '${parentDefinition.inverseKey}' on '${addedIdentifier.type}' type does not implement '${parentDefinition.type}' and thus cannot be assigned to the '${parentDefinition.key}' relationship in '${parentIdentifier.type}'. The definition should specify 'as: "${parentDefinition.type}"' in options.`,
`Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,
@@ -1217,7 +1213,7 @@ class Model extends EmberObject implements MinimalLegacyRecord {
`Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,
@@ -1282,7 +1278,7 @@ class Model extends EmberObject implements MinimalLegacyRecord {
`Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,
@@ -1384,7 +1380,7 @@ class Model extends EmberObject implements MinimalLegacyRecord {
`Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,
@@ -1403,7 +1399,7 @@ class Model extends EmberObject implements MinimalLegacyRecord {
`Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,
@@ -1630,7 +1626,7 @@ class Model extends EmberObject implements MinimalLegacyRecord {
`Accessing schema information on Models without looking up the model via the store is deprecated. Use store.modelFor (or better Snapshots or the store.getSchemaDefinitionService() apis) instead.`,
@@ -1649,7 +1645,7 @@ class Model extends EmberObject implements MinimalLegacyRecord {
0 commit comments