Don't fail when no cards

This will prevent nil errors when parsing the command. Instead, the regular command validation will trigger and the error will be handled as expected.
This commit is contained in:
Jorge Manrubia
2025-05-07 13:49:45 +02:00
parent 87484dbca0
commit 695383da7a
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ module Command::Cards
included do
store_accessor :data, :card_ids
validates_presence_of :card_ids
validates_presence_of :card_ids, :cards
end
def undoable?
+2
View File
@@ -11,6 +11,8 @@ class Command::Parser::Context
user.accessible_cards.where id: params[:id]
elsif controller == "cards" && action == "index"
filter.cards
else
Card.none
end
end