diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 21:18:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 21:18:33 +0300 |
commit | f64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch) | |
tree | a2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /app/models/member.rb | |
parent | bfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff) |
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'app/models/member.rb')
-rw-r--r-- | app/models/member.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/app/models/member.rb b/app/models/member.rb index 62fe757683f..38574d67cb6 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -75,7 +75,20 @@ class Member < ApplicationRecord left_join_users .where(user_ok) - .where(requested_at: nil) + .non_request + .non_minimal_access + .reorder(nil) + end + + scope :blocked, -> do + is_external_invite = arel_table[:user_id].eq(nil).and(arel_table[:invite_token].not_eq(nil)) + user_is_blocked = User.arel_table[:state].eq(:blocked) + + user_ok = Arel::Nodes::Grouping.new(is_external_invite).or(user_is_blocked) + + left_join_users + .where(user_ok) + .non_request .non_minimal_access .reorder(nil) end |