Fix invites not being disabled upon account suspension (#11412)

* Disable invite links from disabled/suspended users

* Add has_many invites relationship to users

* Destroy unused invites when suspending an account
This commit is contained in:
ThibG 2019-07-26 18:55:33 +02:00 committed by Eugen Rochko
parent 6782922584
commit 8904487324
5 changed files with 16 additions and 8 deletions

View file

@ -66,6 +66,7 @@ class SuspendAccountService < BaseService
@account.user.destroy
else
@account.user.disable!
@account.user.invites.where(uses: 0).destroy_all
end
end