diff --git a/lib/pouchdb-adapter.js b/lib/pouchdb-adapter.js index 3cabe86..f6d24e0 100644 --- a/lib/pouchdb-adapter.js +++ b/lib/pouchdb-adapter.js @@ -23,8 +23,7 @@ export default DS.RESTAdapter.extend({ var schemaDef = { singular: singular, - plural: plural, - relations: {} + plural: plural }; // else it's new, so update @@ -38,6 +37,9 @@ export default DS.RESTAdapter.extend({ } var relDef = {}; relDef[rel.kind] = rel.type.typeKey; + if (!schemaDef.relations) { + schemaDef.relations = {}; + } schemaDef.relations[rel.key] = relDef; self._init(rel.type); });