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:
@@ -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?
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user