From a6e17cf50ecba47148307f8b05d0a73e9656a4c7 Mon Sep 17 00:00:00 2001 From: Paco Guzman Date: Fri, 30 Sep 2016 09:26:48 +0200 Subject: Use SELECT 1, instead SELECT COUNT(*) to ask for notes existency --- app/services/system_note_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index bf251816e7e..1ce66d50368 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -347,7 +347,7 @@ module SystemNoteService notes = notes.where(noteable_id: noteable.id) end - notes_for_mentioner(mentioner, noteable, notes).count > 0 + notes_for_mentioner(mentioner, noteable, notes).exists? end # Build an Array of lines detailing each commit added in a merge request -- cgit v1.2.1