From 274a6ad9d55a9db4b03a7f00b38f5bb0269f2fe2 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Thu, 26 Jun 2025 09:37:22 +0200 Subject: [PATCH] Only intercept when string is composed of numbers --- app/models/command/parser.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/command/parser.rb b/app/models/command/parser.rb index aa409e3fc..70ddbcd06 100644 --- a/app/models/command/parser.rb +++ b/app/models/command/parser.rb @@ -89,8 +89,9 @@ class Command::Parser end def multiple_cards_from(string) - if tokens = string.split(/[\s,]+/).filter { it =~ /\A\d+\z/ }.presence - user.accessible_cards.where(id: tokens).presence if tokens.many? + if string.match?(/^[\d\s,]+$/) + tokens = string.split(/[\s,]+/) + user.accessible_cards.where(id: tokens).presence if tokens&.many? end end