group_removed_users associations

This commit is contained in:
2458773093 2019-07-16 09:43:31 +03:00
parent 520c125e21
commit 17a6756bcb
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -10,4 +10,6 @@
#
class GroupRemovedAccount < ApplicationRecord
belongs_to :group
belongs_to :account
end