diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-05-12 09:23:21 +0200 |
---|---|---|
committer | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-05-12 09:23:21 +0200 |
commit | 7a4e7ad04e1fc96953d9159e8e1a2208990d34f7 (patch) | |
tree | b39508df518df88682703b4525f6895113ec4a8a /app | |
parent | 2bbe781d8b45fb9677f5fbe60cf86b2452ef3af4 (diff) | |
download | gitlab-ce-7a4e7ad04e1fc96953d9159e8e1a2208990d34f7.tar.gz |
Fix tests and wrong choices during merge
Diffstat (limited to 'app')
-rw-r--r-- | app/models/concerns/issuable.rb | 8 | ||||
-rw-r--r-- | app/models/note.rb | 2 | ||||
-rw-r--r-- | app/services/notes/create_service.rb | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index 9b77b88ca80..83d3bfe8e17 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -100,6 +100,14 @@ module Issuable order_by(method) end end + + def with_label(title) + if title.is_a?(Array) && title.size > 1 + joins(:labels).where(labels: { title: title }).group(arel_table[:id]).having("COUNT(DISTINCT labels.title) = #{title.size}") + else + joins(:labels).where(labels: { title: title }) + end + end end def today? diff --git a/app/models/note.rb b/app/models/note.rb index f9040f9f364..7235274770d 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -343,6 +343,6 @@ class Note < ActiveRecord::Base def award_emoji_name original_name = note.match(Banzai::Filter::EmojiFilter.emoji_pattern)[1] - Gitlab::AwardEmoji.normilize_emoji_name(original_name) + Gitlab::AwardEmoji.normalize_emoji_name(original_name) end end diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb index bbf7889166d..509deb898b1 100644 --- a/app/services/notes/create_service.rb +++ b/app/services/notes/create_service.rb @@ -7,7 +7,7 @@ module Notes if note.award_emoji? return ToggleAwardEmojiService.new(project, current_user, params). - execute(note.award_emoji_name, note.note) + execute(note.noteable, note.award_emoji_name) end return unless valid_project?(note) |