summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorFabio Busatto <fabio@gitlab.com>2019-03-27 09:01:07 +0000
committerSean McGivern <sean@gitlab.com>2019-03-27 09:01:07 +0000
commit035c8af12e4ea6dbba18255214bad2a53c1b1cf1 (patch)
treefc20eba28a847b6a7d65886dc864450198a75a77 /lib/api/helpers.rb
parent978aa04f30185b5a4adaa5e26d4a9674a8d37811 (diff)
downloadgitlab-ce-035c8af12e4ea6dbba18255214bad2a53c1b1cf1.tar.gz
Resolve "Get milestone by title via API"
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index b8bd180bdc1..8a21d44b4bf 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -302,6 +302,12 @@ module API
end
# rubocop: enable CodeReuse/ActiveRecord
+ # rubocop: disable CodeReuse/ActiveRecord
+ def filter_by_title(items, title)
+ items.where(title: title)
+ end
+ # rubocop: enable CodeReuse/ActiveRecord
+
def filter_by_search(items, text)
items.search(text)
end