fix: select distinct procedures
This commit is contained in:
parent
3f34414145
commit
d167a3ec71
1 changed files with 1 additions and 1 deletions
|
@ -346,7 +346,7 @@ module Administrateurs
|
||||||
private
|
private
|
||||||
|
|
||||||
def filter_procedures(filter)
|
def filter_procedures(filter)
|
||||||
procedures_result = Procedure.joins(:procedures_zones).publiees_ou_closes
|
procedures_result = Procedure.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(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(aasm_state: filter.statuses) if filter.statuses.present?
|
||||||
procedures_result = procedures_result.where('published_at >= ?', filter.from_publication_date) if filter.from_publication_date.present?
|
procedures_result = procedures_result.where('published_at >= ?', filter.from_publication_date) if filter.from_publication_date.present?
|
||||||
|
|
Loading…
Reference in a new issue