From 2500c1a1710ef45b919f40d42ffe20745ed89354 Mon Sep 17 00:00:00 2001 From: jens Date: Wed, 22 Feb 2017 17:52:53 +0100 Subject: [PATCH] When you have already defined a schema on a collection and you refence this in links, there's no need to extend the schema. Just use the current schema --- lib/links/linker.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/links/linker.js b/lib/links/linker.js index e2bc17f..660e062 100644 --- a/lib/links/linker.js +++ b/lib/links/linker.js @@ -266,9 +266,11 @@ export default class Linker { if (this.mainCollection.simpleSchema && this.mainCollection.simpleSchema()) { const schema = createFieldSchema(this.isMany(), this.linkConfig.metadata); - this.mainCollection.attachSchema({ - [this.linkConfig.field]: schema - }); + if(! this.mainCollection.simpleSchema()._schemaKeys.includes(this.linkConfig.field)) { + this.mainCollection.attachSchema({ + [this.linkConfig.field]: schema + }); + } } } @@ -378,4 +380,4 @@ export default class Linker { }) } } -} \ No newline at end of file +}