summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPoornima <poornima.malepati@gmail.com>2017-08-26 18:05:25 +0530
committerPoornima <poornima.malepati@gmail.com>2018-02-05 23:05:54 +0530
commitcca13d1e40812b60462461ca4387324778654960 (patch)
tree3112c01fd9df0205c196fbbdc7bf9d46fd546983 /app
parent1214d8de691494138cbaab10da242c71504158de (diff)
downloadgitlab-ce-cca13d1e40812b60462461ca4387324778654960.tar.gz
Using correct column for sorting users by Recent Sign-in
Removing last_sign_in_at in specs
Diffstat (limited to 'app')
-rw-r--r--app/models/user.rb4
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")