Relax conditions to match collections
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user