From 377244dd45773a5d587eaf3b75ba64702229e34e Mon Sep 17 00:00:00 2001 From: James Lopez Date: Fri, 7 Jul 2017 11:38:01 +0200 Subject: refactor filters --- app/finders/users_finder.rb | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'app/finders/users_finder.rb') diff --git a/app/finders/users_finder.rb b/app/finders/users_finder.rb index ae031162892..c6bfc380c1c 100644 --- a/app/finders/users_finder.rb +++ b/app/finders/users_finder.rb @@ -14,6 +14,8 @@ # external: boolean # class UsersFinder + include Gitlab::Database::CreatedAtFilter + attr_accessor :current_user, :params def initialize(current_user, params = {}) @@ -72,16 +74,4 @@ class UsersFinder users.external end - - def by_created_at(users) - if params[:created_after].present? - users = users.where(users.klass.arel_table[:created_at].gteq(params[:created_after])) - end - - if params[:created_before].present? - users = users.where(users.klass.arel_table[:created_at].lteq(params[:created_before])) - end - - users - end end -- cgit v1.2.1