feat(export): can sort by revision first, instead of mixing revisions
This commit is contained in:
parent
d69dc6e2c9
commit
58c00b2d4e
1 changed files with 7 additions and 2 deletions
|
@ -104,8 +104,13 @@ class Procedure < ApplicationRecord
|
||||||
|
|
||||||
TypeDeChamp
|
TypeDeChamp
|
||||||
.joins(:revision_types_de_champ)
|
.joins(:revision_types_de_champ)
|
||||||
.where(revision_types_de_champ: { id: recents_prtdc })
|
.where(revision_types_de_champ: { id: recents_prtdc }).then do |relation|
|
||||||
.order(:private, :position, 'revision_types_de_champ.revision_id': :desc)
|
if feature_enabled?(:export_order_by_revision) # Fonds Verts, en attente d'exports personnalisables
|
||||||
|
relation.order(:private, 'revision_types_de_champ.revision_id': :desc, position: :asc)
|
||||||
|
else
|
||||||
|
relation.order(:private, :position, 'revision_types_de_champ.revision_id': :desc)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue