controller

This commit is contained in:
Kara Diaby 2023-01-13 15:23:57 +01:00
parent b81c36c6b8
commit 04b86e9c55

View file

@ -369,6 +369,7 @@ module Administrateurs
procedures_result = Procedure.select(:id).joins(:procedures_zones).distinct.publiees_ou_closes
procedures_result = procedures_result.where(procedures_zones: { zone_id: filter.zone_ids }) if filter.zone_ids.present?
procedures_result = procedures_result.where(aasm_state: filter.statuses) if filter.statuses.present?
procedures_result = procedures_result.where("? = ANY(tags)", filter.tag) if filter.tag.present?
procedures_result = procedures_result.where('published_at >= ?', filter.from_publication_date) if filter.from_publication_date.present?
procedures_result = procedures_result.where('unaccent(libelle) ILIKE unaccent(?)', "%#{filter.libelle}%") if filter.libelle.present?
procedures_sql = procedures_result.to_sql