Merge pull request #1257 from betagouv/fix-1199
[Fix #1199] Implement id search for experts
This commit is contained in:
commit
490a6dee4c
2 changed files with 7 additions and 2 deletions
|
@ -5,10 +5,14 @@ module NewGestionnaire
|
|||
|
||||
# exact id match?
|
||||
if @search_terms.to_i != 0
|
||||
@dossiers = current_gestionnaire.dossiers.where(id: @search_terms.to_i)
|
||||
@dossiers = current_gestionnaire.dossiers.where(id: @search_terms.to_i) +
|
||||
current_gestionnaire.dossiers_from_avis.where(id: @search_terms.to_i)
|
||||
@dossiers.uniq!
|
||||
end
|
||||
|
||||
@dossiers = Dossier.none if @dossiers.nil?
|
||||
if @dossiers.nil?
|
||||
@dossiers = Dossier.none
|
||||
end
|
||||
|
||||
# full text search
|
||||
if @dossiers.empty?
|
||||
|
|
|
@ -10,6 +10,7 @@ class Gestionnaire < ActiveRecord::Base
|
|||
has_many :followed_dossiers, through: :follows, source: :dossier
|
||||
has_many :follows
|
||||
has_many :avis
|
||||
has_many :dossiers_from_avis, through: :avis, source: :dossier
|
||||
|
||||
include CredentialsSyncableConcern
|
||||
|
||||
|
|
Loading…
Reference in a new issue