chore: fix the failing user destroy for admin (#3223)

- fix the invitee association on the user
- handle Instagram events with inbox missing
This commit is contained in:
Sojan Jose
2021-10-16 00:11:53 +05:30
committed by GitHub
parent de0702b679
commit 3b53ca157c
4 changed files with 8 additions and 3 deletions

View File

@@ -78,7 +78,7 @@ class User < ApplicationRecord
has_many :inbox_members, dependent: :destroy
has_many :inboxes, through: :inbox_members, source: :inbox
has_many :messages, as: :sender
has_many :invitees, through: :account_users, class_name: 'User', foreign_key: 'inviter_id', dependent: :nullify
has_many :invitees, through: :account_users, class_name: 'User', foreign_key: 'inviter_id', source: :inviter, dependent: :nullify
has_many :notifications, dependent: :destroy
has_many :notification_settings, dependent: :destroy