diff options
author | Rémy Coutable <remy@rymai.me> | 2018-02-06 09:18:42 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-02-06 09:18:42 +0000 |
commit | 9483cbab26ad239c7a102f887177aaf354c9d13c (patch) | |
tree | 8a9c8b3e648fd1b5442c241b38473cb0e13afb93 /app/models/user.rb | |
parent | 84bda43a3c0ce13a436748d0bc0ea943f6ebccb3 (diff) | |
parent | cca13d1e40812b60462461ca4387324778654960 (diff) | |
download | gitlab-ce-9483cbab26ad239c7a102f887177aaf354c9d13c.tar.gz |
Merge branch '26468-fix-admin-recent-sign-in' into 'master'
Using correct column for sorting users by Recent Sign-in
Closes #26468
See merge request gitlab-org/gitlab-ce!13852
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 4b44e9bb7eb..4996cea718c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -230,8 +230,8 @@ class User < ActiveRecord::Base scope :active, -> { with_state(:active).non_internal } scope :without_projects, -> { where('id NOT IN (SELECT DISTINCT(user_id) FROM members WHERE user_id IS NOT NULL AND requested_at IS NULL)') } scope :todo_authors, ->(user_id, state) { where(id: Todo.where(user_id: user_id, state: state).select(:author_id)) } - scope :order_recent_sign_in, -> { reorder(Gitlab::Database.nulls_last_order('last_sign_in_at', 'DESC')) } - scope :order_oldest_sign_in, -> { reorder(Gitlab::Database.nulls_last_order('last_sign_in_at', 'ASC')) } + scope :order_recent_sign_in, -> { reorder(Gitlab::Database.nulls_last_order('current_sign_in_at', 'DESC')) } + scope :order_oldest_sign_in, -> { reorder(Gitlab::Database.nulls_last_order('current_sign_in_at', 'ASC')) } def self.with_two_factor joins("LEFT OUTER JOIN u2f_registrations AS u2f ON u2f.user_id = users.id") |