diff --git a/app/models/group.rb b/app/models/group.rb index 562c24a1..5b62a208 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -28,6 +28,9 @@ class Group < ApplicationRecord has_many :group_accounts, inverse_of: :group, dependent: :destroy has_many :accounts, through: :group_accounts + has_many :group_removed_accounts, inverse_of: :group, dependent: :destroy + has_many :removed_accounts, source: :account, through: :group_removed_accounts + validates :title, presence: true validates :description, presence: true diff --git a/app/models/group_removed_account.rb b/app/models/group_removed_account.rb index 0f509708..5b6f1a6d 100644 --- a/app/models/group_removed_account.rb +++ b/app/models/group_removed_account.rb @@ -10,4 +10,6 @@ # class GroupRemovedAccount < ApplicationRecord + belongs_to :group + belongs_to :account end