diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-22 18:07:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-22 18:07:25 +0300 |
commit | e01b61d83fd7c5d3aa9d87a65eac85e8c7ea9921 (patch) | |
tree | 90e1a1f3ebbeab0f2f8714f42211800a213a1002 /app/models/member.rb | |
parent | 4220cf46a314ac1c4d88be13608752bc07bb28fb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/member.rb')
-rw-r--r-- | app/models/member.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/member.rb b/app/models/member.rb index 528c6855d9c..e00f82614c6 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -181,6 +181,10 @@ class Member < ApplicationRecord scope :order_name_desc, -> { left_join_users.reorder(Gitlab::Database.nulls_last_order('users.name', 'DESC')) } scope :order_recent_sign_in, -> { left_join_users.reorder(Gitlab::Database.nulls_last_order('users.last_sign_in_at', 'DESC')) } scope :order_oldest_sign_in, -> { left_join_users.reorder(Gitlab::Database.nulls_last_order('users.last_sign_in_at', 'ASC')) } + scope :order_recent_last_activity, -> { left_join_users.reorder(Gitlab::Database.nulls_last_order('users.last_activity_on', 'DESC')) } + scope :order_oldest_last_activity, -> { left_join_users.reorder(Gitlab::Database.nulls_first_order('users.last_activity_on', 'ASC')) } + scope :order_recent_created_user, -> { left_join_users.reorder(Gitlab::Database.nulls_last_order('users.created_at', 'DESC')) } + scope :order_oldest_created_user, -> { left_join_users.reorder(Gitlab::Database.nulls_first_order('users.created_at', 'ASC')) } scope :on_project_and_ancestors, ->(project) { where(source: [project] + project.ancestors) } @@ -232,6 +236,10 @@ class Member < ApplicationRecord when 'access_level_desc' then reorder(access_level: :desc) when 'recent_sign_in' then order_recent_sign_in when 'oldest_sign_in' then order_oldest_sign_in + when 'recent_created_user' then order_recent_created_user + when 'oldest_created_user' then order_oldest_created_user + when 'recent_last_activity' then order_recent_last_activity + when 'oldest_last_activity' then order_oldest_last_activity when 'last_joined' then order_created_desc when 'oldest_joined' then order_created_asc else |