From 0a168bf6d6a56f3377233f7f220b0e3ce14f010c Mon Sep 17 00:00:00 2001 From: "Brian J. Geiger" Date: Mon, 14 Aug 2023 13:55:41 -0400 Subject: [PATCH] Make relationships polymorphic --- app/models/log.ts | 2 +- app/models/wiki.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/log.ts b/app/models/log.ts index 2849ec2b88..b7c148353e 100644 --- a/app/models/log.ts +++ b/app/models/log.ts @@ -12,7 +12,7 @@ export default class LogModel extends OsfModel { @belongsTo('node', { inverse: null }) node!: AsyncBelongsTo & NodeModel; - @belongsTo('node', { inverse: 'logs' }) + @belongsTo('node', { polymorphic: true, inverse: 'logs' }) originalNode!: AsyncBelongsTo & NodeModel; @belongsTo('user') diff --git a/app/models/wiki.ts b/app/models/wiki.ts index 623b70b790..111b84fee4 100644 --- a/app/models/wiki.ts +++ b/app/models/wiki.ts @@ -15,7 +15,7 @@ export default class WikiModel extends OsfModel { @attr('string') materializedPath!: string; @attr('number') size!: number; - @belongsTo('node', { inverse: 'wikis' }) + @belongsTo('node', { polymorphic: true, inverse: 'wikis' }) node!: AsyncBelongsTo & NodeModel; }