diff --git a/app/deprecation-workflow.js b/app/deprecation-workflow.js index 5b46a359..0f8fdf12 100644 --- a/app/deprecation-workflow.js +++ b/app/deprecation-workflow.js @@ -2,8 +2,6 @@ import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow'; setupDeprecationWorkflow({ workflow: [ - { handler: 'silence', matchId: 'ember-simple-auth.initializer.setup-session-restoration' }, - { handler: 'silence', matchId: 'ember-data:deprecate-non-strict-relationships' }, { handler: 'silence', matchId: 'ember-data:deprecate-early-static' }, { handler: 'silence', matchId: 'ensure-safe-component.string' }, { handler: 'silence', matchId: 'routing.transition-methods' }, diff --git a/app/models/deposit.js b/app/models/deposit.js index 2db3fd6f..a0fc767e 100644 --- a/app/models/deposit.js +++ b/app/models/deposit.js @@ -4,9 +4,9 @@ export default class DepositModel extends Model { @attr('string') depositStatusRef; @attr('string') depositStatus; - @belongsTo('repositoryCopy') repositoryCopy; - @belongsTo('submission') submission; - @belongsTo('repository') repository; + @belongsTo('repositoryCopy', { async: false, inverse: null }) repositoryCopy; + @belongsTo('submission', { async: false, inverse: null }) submission; + @belongsTo('repository', { async: false, inverse: null }) repository; } export const DepositStatus = { diff --git a/app/models/file.js b/app/models/file.js index 766434ac..e29179f1 100644 --- a/app/models/file.js +++ b/app/models/file.js @@ -8,7 +8,7 @@ export default class FileModel extends Model { @attr('string') uri; @attr('string') mimeType; - @belongsTo('submission') submission; + @belongsTo('submission', { async: false, inverse: null }) submission; // not represented on backend // @attr('string') _file; diff --git a/app/models/funder.js b/app/models/funder.js index 933f75d5..68fcddb9 100644 --- a/app/models/funder.js +++ b/app/models/funder.js @@ -5,5 +5,5 @@ export default class FunderModel extends Model { @attr('string') url; @attr('string') localKey; - @belongsTo('policy') policy; + @belongsTo('policy', { async: false, inverse: null }) policy; } diff --git a/app/models/grant.js b/app/models/grant.js index c116336f..b96cc3c0 100644 --- a/app/models/grant.js +++ b/app/models/grant.js @@ -12,8 +12,8 @@ export default class GrantModel extends Model { /** Date the grant ended */ @attr('date') endDate; - @belongsTo('user') pi; - @hasMany('user') coPis; - @belongsTo('funder') primaryFunder; - @belongsTo('funder') directFunder; + @belongsTo('user', { async: false, inverse: null }) pi; + @hasMany('user', { async: false, inverse: null }) coPis; + @belongsTo('funder', { async: true, inverse: null }) primaryFunder; + @belongsTo('funder', { async: false, inverse: null }) directFunder; } diff --git a/app/models/policy.js b/app/models/policy.js index f1395489..34ceda44 100644 --- a/app/models/policy.js +++ b/app/models/policy.js @@ -5,7 +5,7 @@ export default class PolicyModel extends Model { @attr('string') description; @attr('string') policyUrl; - @hasMany('repository') repositories; + @hasMany('repository', { async: false, inverse: null }) repositories; @attr('string') institution; @attr('string') _type; diff --git a/app/models/publication.js b/app/models/publication.js index 1ab4ef58..2d0cd1fa 100644 --- a/app/models/publication.js +++ b/app/models/publication.js @@ -9,8 +9,7 @@ export default class PublicationModel extends Model { @attr('string') issue; @attr('string') pmid; - @belongsTo('journal', { autoSave: true }) journal; - // submissions: DS.hasMany('submission', { async: true }) + @belongsTo('journal', { async: false, inverse: null, autoSave: true }) journal; get abstract() { return this.publicationAbstract; } diff --git a/app/models/repository-copy.js b/app/models/repository-copy.js index 220b0509..47eb76cf 100644 --- a/app/models/repository-copy.js +++ b/app/models/repository-copy.js @@ -5,8 +5,8 @@ export default class RepositoryCopyModel extends Model { @attr('string') accessUrl; @attr('string') copyStatus; - @belongsTo('publication') publication; - @belongsTo('repository') repository; + @belongsTo('publication', { async: false, inverse: null }) publication; + @belongsTo('repository', { async: false, inverse: null }) repository; } export const CopyStatus = { diff --git a/app/models/submission-event.js b/app/models/submission-event.js index d345266e..7620600a 100644 --- a/app/models/submission-event.js +++ b/app/models/submission-event.js @@ -7,8 +7,8 @@ export default class SubmissionEventModel extends Model { @attr('string') comment; @attr('string') link; - @belongsTo('submission') submission; - @belongsTo('user') performedBy; + @belongsTo('submission', { async: true, inverse: '_submissionEvents' }) submission; + @belongsTo('user', { async: false, inverse: null }) performedBy; } export const Type = { diff --git a/app/models/submission.js b/app/models/submission.js index 84d20d46..fd6c4a7c 100644 --- a/app/models/submission.js +++ b/app/models/submission.js @@ -20,15 +20,16 @@ export default class SubmissionModel extends Model { submitterEmail; @attr('number') version; - @belongsTo('user') submitter; - @belongsTo('publication') publication; + @belongsTo('user', { async: false, inverse: null }) submitter; + @belongsTo('publication', { async: false, inverse: null }) publication; - @hasMany('user') preparers; - @hasMany('repository') repositories; - @hasMany('policy') effectivePolicies; + @hasMany('user', { async: false, inverse: null }) preparers; + @hasMany('repository', { async: true, inverse: null }) repositories; + @hasMany('policy', { async: false, inverse: null }) effectivePolicies; // not on this model on API @hasMany('submissionEvent', { async: true, + inverse: 'submission', }) _submissionEvents; /** @@ -38,6 +39,7 @@ export default class SubmissionModel extends Model { */ @hasMany('grant', { async: true, + inverse: null, }) grants;