diff options
author | Poornima <poornima.malepati@gmail.com> | 2017-08-26 15:35:25 +0300 |
---|---|---|
committer | Poornima <poornima.malepati@gmail.com> | 2018-02-05 20:35:54 +0300 |
commit | cca13d1e40812b60462461ca4387324778654960 (patch) | |
tree | 3112c01fd9df0205c196fbbdc7bf9d46fd546983 /app/models/user.rb | |
parent | 1214d8de691494138cbaab10da242c71504158de (diff) |
Using correct column for sorting users by Recent Sign-in
Removing last_sign_in_at in specs
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 a57ba3740c9..3a3eced0e31 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") |