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
path: root/lib
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-07-18 10:35:30 +0300
committerRémy Coutable <remy@rymai.me>2016-07-18 10:35:30 +0300
commit65352b5baaf269a609b024fd13efc81e8bbdcefa (patch)
treed311bae9c90a704f2427aadf442ac4c69407e731 /lib
parent1bf57b75119deb79f5826245d4c69a0a83cc4864 (diff)
parente21492b810bf9cd30f0e60836c056a72e830f427 (diff)
Merge branch 'normalize_emoji_aliases_paths' into 'master'
Fix not normalized emoji paths ## What does this MR do? It normalizes emoji names in `api` and `toggle_award` ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? User was able to store +1 and thumbsup to databse, causing UI inconsistency. ## What are the relevant issue numbers? Fixes #19104 ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] API support added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5060
Diffstat (limited to 'lib')
-rw-r--r--lib/api/award_emoji.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/award_emoji.rb b/lib/api/award_emoji.rb
index c4fa1838b5a..2efe7e3adf3 100644
--- a/lib/api/award_emoji.rb
+++ b/lib/api/award_emoji.rb
@@ -56,9 +56,9 @@ module API
not_found!('Award Emoji') unless can_read_awardable?
- award = awardable.award_emoji.new(name: params[:name], user: current_user)
+ award = awardable.create_award_emoji(params[:name], current_user)
- if award.save
+ if award.persisted?
present award, with: Entities::AwardEmoji
else
not_found!("Award Emoji #{award.errors.messages}")