Merge pull request #9886 from colinux/export-ff-active-revision-first
Tech exports: feature flat pour trier les colonnes par révision récente puis position plutôt que mélanger les révisions entre elles
This commit is contained in:
commit
2f53a017b4
1 changed files with 7 additions and 2 deletions
|
@ -104,8 +104,13 @@ class Procedure < ApplicationRecord
|
|||
|
||||
TypeDeChamp
|
||||
.joins(:revision_types_de_champ)
|
||||
.where(revision_types_de_champ: { id: recents_prtdc })
|
||||
.order(:private, :position, 'revision_types_de_champ.revision_id': :desc)
|
||||
.where(revision_types_de_champ: { id: recents_prtdc }).then do |relation|
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue