From 799ff520042109201695677853298a46a3d15b0d Mon Sep 17 00:00:00 2001 From: Toks Date: Mon, 15 Jul 2013 19:09:49 -0400 Subject: [PATCH] Allow searching tags by list of comma-delimited names --- app/models/tag.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/tag.rb b/app/models/tag.rb index 7bc9eecd4..9cab0c820 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -563,6 +563,10 @@ class Tag < ActiveRecord::Base q = q.name_matches(params[:name_matches].strip.tr(" ", "_")) end + if params[:name].present? + q = q.where("name in (?)", params[:name].split(",")) + end + if params[:category].present? q = q.where("category = ?", params[:category]) end