Remove semantic searches
We may revisit in the future but we'll go with keyword search only for launch
This commit is contained in:
@@ -12,7 +12,7 @@ class Command::Parser::Context
|
||||
if viewing_card_contents?
|
||||
user.accessible_cards.where id: params[:id]
|
||||
elsif viewing_list_of_cards?
|
||||
filter.cards.published
|
||||
filtered_cards
|
||||
else
|
||||
Card.none
|
||||
end
|
||||
@@ -33,6 +33,9 @@ class Command::Parser::Context
|
||||
private
|
||||
attr_reader :controller, :action, :params
|
||||
|
||||
MAX_CARDS = 20
|
||||
MAX_CLOSED_CARDS = 10
|
||||
|
||||
def extract_url_components
|
||||
uri = URI.parse(url || "")
|
||||
route = Rails.application.routes.recognize_path(uri.path)
|
||||
@@ -40,4 +43,11 @@ class Command::Parser::Context
|
||||
@action = route[:action]
|
||||
@params = ActionController::Parameters.new(Rack::Utils.parse_nested_query(uri.query).merge(route.except(:controller, :action)))
|
||||
end
|
||||
|
||||
def filtered_cards
|
||||
open_cards = filter.cards.published.limit(MAX_CARDS)
|
||||
closed_cards = filter.indexed_by.stalled? || filter.indexed_by.closed? ? Card.none : filter.with(indexed_by: "closed").cards.limit(MAX_CLOSED_CARDS)
|
||||
Rails.logger.info "CLOSED CARDS: #{closed_cards.collect(&:title)}"
|
||||
user.accessible_cards.where(id: open_cards.ids + closed_cards.ids)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user