Skip to content

Commit

Permalink
Merge pull request #2569 from gilest/fix/filter-out-shim-model-class
Browse files Browse the repository at this point in the history
Filter out `ShimModelClass` instances when running `discoverEmberDataModels`
  • Loading branch information
SergeAstapov authored Feb 21, 2024
2 parents 3e0739e + 5a72de0 commit 259505c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ember-cli-mirage/addon/utils/ember-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export const hasEmberData =
@hide
*/
export function isDsModel(m) {
return m && typeof m.eachRelationship === 'function';
return m && typeof m.eachRelationship === 'function' && m.isModel === true;
}
10 changes: 10 additions & 0 deletions test-packages/01-basic-app/app/models/shim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Mimics the static apis of ShimModelClass from ember-data
export default class Shim {
fields;
attributes;
relationshipsByName;

eachAttribute() {}
eachRelationship() {}
eachTransformedAttribute() {}
}

0 comments on commit 259505c

Please sign in to comment.