summaryrefslogtreecommitdiff
path: root/app/services/notes/create_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/notes/create_service.rb')
-rw-r--r--app/services/notes/create_service.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb
index 01586994813..02fca5c0ea3 100644
--- a/app/services/notes/create_service.rb
+++ b/app/services/notes/create_service.rb
@@ -5,7 +5,12 @@ module Notes
note.author = current_user
note.system = false
- return unless valid_project?(note)
+ if note.award_emoji?
+ noteable = note.noteable
+ todo_service.new_award_emoji(noteable, current_user)
+
+ return noteable.create_award_emoji(note.award_emoji_name, current_user)
+ end
if note.save
# Finish the harder work in the background
@@ -15,14 +20,5 @@ module Notes
note
end
-
- private
-
- def valid_project?(note)
- return false unless project
- return true if note.for_commit?
-
- note.noteable.try(:project) == project
- end
end
end