diff --git a/app/models/command/ai/parser.rb b/app/models/command/ai/parser.rb index e795fd87f..09095b425 100644 --- a/app/models/command/ai/parser.rb +++ b/app/models/command/ai/parser.rb @@ -44,7 +44,7 @@ class Command::Ai::Parser if query_context = query_json["context"].presence query_context["assignee_ids"] = query_context["assignee_ids"]&.filter_map { |name| assignee_from(name)&.id } query_context["creator_id"] = assignee_from(query_context["creator_id"])&.id if query_context["creator_id"] - query_context["collection_ids"] = query_context["collection_ids"]&.filter_map { |name| Collection.where("lower(name) = ?", name.downcase).first&.id } + query_context["collection_ids"] = query_context["collection_ids"]&.filter_map { |name| Collection.where("lower(name) like ?", "%#{name.downcase}%").first&.id } query_context["tag_ids"] = query_context["tag_ids"]&.filter_map { |name| ::Tag.find_by_title(name)&.id } query_context.compact! end