Merge branch 'develop' into staging

This commit is contained in:
Xavier J 2016-11-21 10:46:29 +01:00
commit 2568a53951

View file

@ -35,14 +35,19 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
def search def search
@search_terms = params[:q] @search_terms = params[:q]
@dossier = Search.new( # exact id match?
gestionnaire: current_gestionnaire, @dossier = Dossier.where(id: @search_terms)
query: @search_terms,
page: params[:page] # full text search
).results unless @dossier.any?
@dossier ||= Search.new(
gestionnaire: current_gestionnaire,
query: @search_terms,
page: params[:page]
).results
end
smartlisting_dossier @dossier, 'search' smartlisting_dossier @dossier, 'search'
rescue RuntimeError rescue RuntimeError
smartlisting_dossier [], 'search' smartlisting_dossier [], 'search'
end end