From 7e76fbe31eeae1b998278fc621346056fd8d85d1 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Sun, 17 Mar 2019 00:14:59 -0700 Subject: [PATCH] unnecessary associations, rather do references --- app/config/associate.js | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 app/config/associate.js diff --git a/app/config/associate.js b/app/config/associate.js deleted file mode 100644 index 537dd2b..0000000 --- a/app/config/associate.js +++ /dev/null @@ -1,24 +0,0 @@ -module.exports = models => { - const { - donor, - Grant, - Cause, - Region, - Organization, - Charge, - PaymentPlan, - GrantsOrganizations, - Project - } = models; - console.log(models); - - donor.hasMany(Grant, { foreignKey: 'donor_id' }); - - Grant.belongsToMany(Organization, { - through: 'Grant_Organization', - foreignKey: 'grant_id', - otherKey: 'organization_id' - }); - - Grant.hasMany(Charge, { foreignKey: 'grant_id' }); -};