summaryrefslogtreecommitdiff
path: root/app/controllers/autocomplete_controller.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2017-09-19 14:22:43 -0400
committerRobert Speicher <rspeicher@gmail.com>2017-12-19 15:45:08 -0600
commit2f92238a6ea5550f94a4ece8453cbf6bdee1f77d (patch)
tree0fd399f271e79ff4375efb2d3a206b4327fdcbd1 /app/controllers/autocomplete_controller.rb
parent6f1df8dfaabfebeb5e9ffbd785f263314b817324 (diff)
downloadgitlab-ce-2f92238a6ea5550f94a4ece8453cbf6bdee1f77d.tar.gz
Use UserSerializer instead of `User.to_json`
Diffstat (limited to 'app/controllers/autocomplete_controller.rb')
-rw-r--r--app/controllers/autocomplete_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/autocomplete_controller.rb b/app/controllers/autocomplete_controller.rb
index cde1e284d2d..86bade49ec9 100644
--- a/app/controllers/autocomplete_controller.rb
+++ b/app/controllers/autocomplete_controller.rb
@@ -8,12 +8,12 @@ class AutocompleteController < ApplicationController
def users
@users = AutocompleteUsersFinder.new(params: params, current_user: current_user, project: @project, group: @group).execute
- render json: @users, only: [:name, :username, :id], methods: [:avatar_url]
+ render json: UserSerializer.new.represent(@users)
end
def user
@user = User.find(params[:id])
- render json: @user, only: [:name, :username, :id], methods: [:avatar_url]
+ render json: UserSerializer.new.represent(@user)
end
def projects