Do not show deleted users as members of groups (fixes #587)
This commit is contained in:
parent
f8507655df
commit
a4f5b8fb33
1 changed files with 1 additions and 1 deletions
|
@ -6,7 +6,7 @@ class Group < ApplicationRecord
|
||||||
include MarkAsDeletedWithName
|
include MarkAsDeletedWithName
|
||||||
|
|
||||||
has_many :memberships, dependent: :destroy
|
has_many :memberships, dependent: :destroy
|
||||||
has_many :users, :through => :memberships
|
has_many :users, -> { where(deleted_at: nil) }, through: :memberships
|
||||||
|
|
||||||
validates :name, :presence => true, :length => {:in => 1..25}
|
validates :name, :presence => true, :length => {:in => 1..25}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue