Commit 7c5643ee authored by George Tsiolis's avatar George Tsiolis

Move EE only differences for finders

parent e9d0bd8e
......@@ -14,7 +14,6 @@
# active: boolean
# blocked: boolean
# external: boolean
# skip_ldap: boolean
#
class UsersFinder
include CreatedAtFilter
......@@ -38,7 +37,6 @@ class UsersFinder
users = by_2fa(users)
users = by_created_at(users)
users = by_custom_attributes(users)
users = by_non_ldap(users)
users
end
......@@ -86,12 +84,6 @@ class UsersFinder
end
# rubocop: enable CodeReuse/ActiveRecord
def by_non_ldap(users)
return users unless params[:skip_ldap]
users.non_ldap
end
def by_2fa(users)
case params[:two_factor]
when 'enabled'
......@@ -103,3 +95,5 @@ class UsersFinder
end
end
end
UsersFinder.prepend(EE::UsersFinder)
# frozen_string_literal: true
module EE
module UsersFinder
extend ::Gitlab::Utils::Override
override :execute
def execute
by_non_ldap(super)
end
def by_non_ldap(users)
return users unless params[:skip_ldap]
users.non_ldap
end
end
end
---
title: Move EE only differences for finders
merge_request: 8629
author: George Tsiolis
type: other
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment