Skip to content

Commit

Permalink
use the new store.isFragment method
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinJoyce committed Jan 16, 2017
1 parent 37cc674 commit 5e8b416
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addon/model-definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class ModelDefinition {
@returns {Boolean} true if it's a model fragment
*/
isModelAFragment() {
if(FactoryGuy.store.isFragment) { //added in `ember-data-model-fragments` v2.3.x
return FactoryGuy.store.isFragment(this.modelName);
}

try {
if (FactoryGuy.store.createFragment) {
return !!FactoryGuy.store.createFragment(this.modelName);
Expand Down Expand Up @@ -350,4 +354,4 @@ class ModelDefinition {
}
}

export default ModelDefinition;
export default ModelDefinition;

0 comments on commit 5e8b416

Please sign in to comment.