Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2017-09-19 21:22:43 +0300
committerRobert Speicher <rspeicher@gmail.com>2017-12-20 00:45:08 +0300
commit2f92238a6ea5550f94a4ece8453cbf6bdee1f77d (patch)
tree0fd399f271e79ff4375efb2d3a206b4327fdcbd1 /app/helpers
parent6f1df8dfaabfebeb5e9ffbd785f263314b817324 (diff)
Use UserSerializer instead of `User.to_json`
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/form_helper.rb2
-rw-r--r--app/helpers/issuables_helper.rb2
-rw-r--r--app/helpers/search_helper.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/form_helper.rb b/app/helpers/form_helper.rb
index b5dece38de1..e26ce6da030 100644
--- a/app/helpers/form_helper.rb
+++ b/app/helpers/form_helper.rb
@@ -35,7 +35,7 @@ module FormHelper
multi_select: true,
'input-meta': 'name',
'always-show-selectbox': true,
- current_user_info: current_user.to_json(only: [:id, :name])
+ current_user_info: UserSerializer.new.represent(current_user)
}
}
end
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb
index b4ca0e68e0b..2668cf78afe 100644
--- a/app/helpers/issuables_helper.rb
+++ b/app/helpers/issuables_helper.rb
@@ -362,7 +362,7 @@ module IssuablesHelper
moveIssueEndpoint: move_namespace_project_issue_path(namespace_id: issuable.project.namespace.to_param, project_id: issuable.project, id: issuable),
projectsAutocompleteEndpoint: autocomplete_projects_path(project_id: @project.id),
editable: can_edit_issuable,
- currentUser: current_user.as_json(only: [:username, :id, :name], methods: :avatar_url),
+ currentUser: UserSerializer.new.represent(current_user),
rootPath: root_path,
fullPath: @project.full_path
}
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 2f57660516d..0f9ac958f95 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -139,7 +139,7 @@ module SearchHelper
id: "filtered-search-#{type}",
placeholder: 'Search or filter results...',
data: {
- 'username-params' => @users.to_json(only: [:id, :username])
+ 'username-params' => UserSerializer.new.represent(@users)
},
autocomplete: 'off'
}