From 7a4e7ad04e1fc96953d9159e8e1a2208990d34f7 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Thu, 12 May 2016 09:23:21 +0200 Subject: Fix tests and wrong choices during merge --- app/models/concerns/issuable.rb | 8 ++++++++ app/models/note.rb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'app/models') 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 -- cgit v1.2.1