diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-16 18:08:46 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-16 18:08:46 +0000 |
commit | aa0f0e992153e84e1cdec8a1c7310d5eb93a9f8f (patch) | |
tree | 4a662bc77fb43e1d1deec78cc7a95d911c0da1c5 /app/models/user.rb | |
parent | d47f9d2304dbc3a23bba7fe7a5cd07218eeb41cd (diff) | |
download | gitlab-ce-aa0f0e992153e84e1cdec8a1c7310d5eb93a9f8f.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 6442e74bbe3..4bba4d47b8f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -307,6 +307,8 @@ class User < ApplicationRecord scope :blocked, -> { with_states(:blocked, :ldap_blocked) } scope :external, -> { where(external: true) } scope :active, -> { with_state(:active).non_internal } + scope :active_without_ghosts, -> { with_state(:active).without_ghosts } + scope :without_ghosts, -> { where('ghost IS NOT TRUE') } scope :deactivated, -> { with_state(:deactivated).non_internal } scope :without_projects, -> { joins('LEFT JOIN project_authorizations ON users.id = project_authorizations.user_id').where(project_authorizations: { user_id: nil }) } scope :order_recent_sign_in, -> { reorder(Gitlab::Database.nulls_last_order('current_sign_in_at', 'DESC')) } @@ -470,7 +472,7 @@ class User < ApplicationRecord when 'deactivated' deactivated else - active + active_without_ghosts end end @@ -614,7 +616,7 @@ class User < ApplicationRecord end def self.non_internal - where('ghost IS NOT TRUE') + without_ghosts end # |