Extract method
This commit is contained in:
@@ -39,7 +39,7 @@ class Command::Parser
|
||||
def parse_free_string(string)
|
||||
if cards = multiple_cards_from(string)
|
||||
Command::FilterCards.new(card_ids: cards.ids, params: filter.as_params)
|
||||
elsif card = user.accessible_cards.find_by_id(string)
|
||||
elsif card = single_card_from(string)
|
||||
Command::GoToCard.new(card_id: card.id)
|
||||
else
|
||||
Command::Search.new(query: string, params: filter.as_params)
|
||||
@@ -54,4 +54,8 @@ class Command::Parser
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def single_card_from(string)
|
||||
user.accessible_cards.find_by_id(string)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user