summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-10-24 15:12:38 +0000
committerMike Greiling <mike@pixelcog.com>2018-10-24 15:12:38 +0000
commita6af6bf6e21bb5b36a94ba334c99bc586cb3297b (patch)
tree41a63f8d85f562573f45aa5898d749ceb51606a5 /lib/api/helpers.rb
parentac8f85805c0ff7dd00072b2974fdd05724863816 (diff)
parenta1ee2072f1a7c197e13bd2d5f8ca59ad1deb1c49 (diff)
downloadgitlab-ce-prettify-all-the-things-7.tar.gz
Merge branch 'master' into 'prettify-all-the-things-7'prettify-all-the-things-7
# Conflicts: # app/assets/javascripts/activities.js
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index a7ba8066233..60bf977f0e4 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -96,15 +96,9 @@ module API
LabelsFinder.new(current_user, search_params).execute
end
- # rubocop: disable CodeReuse/ActiveRecord
def find_user(id)
- if id =~ /^\d+$/
- User.find_by(id: id)
- else
- User.find_by(username: id)
- end
+ UserFinder.new(id).find_by_id_or_username
end
- # rubocop: enable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
def find_project(id)