diff options
author | ThibG <thib@sitedethib.com> | 2019-07-26 18:55:33 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-07-26 18:55:33 +0200 |
commit | 92569ffde81a3fe768fd8773fdab5d1a927f3f88 (patch) | |
tree | d5544ac69ccea9235baf679c1988ff8e811662ef /app/models/user.rb | |
parent | a6b44401156524ef70a5917d17c93886c5e20a0d (diff) |
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
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 474c77293..6806c0362 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -73,6 +73,7 @@ class User < ApplicationRecord has_many :applications, class_name: 'Doorkeeper::Application', as: :owner has_many :backups, inverse_of: :user + has_many :invites, inverse_of: :user has_one :invite_request, class_name: 'UserInviteRequest', inverse_of: :user, dependent: :destroy accepts_nested_attributes_for :invite_request, reject_if: ->(attributes) { attributes['text'].blank? } |