[fix #992] export: dossiers are order by initiated_at

This commit is contained in:
Simon Lehericey 2017-12-01 12:24:41 +01:00
parent 479a7ca0d0
commit e2bbd2a37a
3 changed files with 8 additions and 11 deletions

View file

@ -58,7 +58,7 @@ class Dossier < ActiveRecord::Base
scope :nouveaux, -> { not_archived.state_nouveaux }
scope :en_instruction, -> { not_archived.state_en_instruction }
scope :termine, -> { not_archived.state_termine }
scope :downloadable, -> { state_not_brouillon.includes(:entreprise, :etablissement, :champs, :champs_private) }
scope :downloadable_sorted, -> { state_not_brouillon.includes(:entreprise, :etablissement, :champs, :champs_private).order(initiated_at: 'asc') }
scope :en_cours, -> { not_archived.state_en_construction_ou_instruction }
scope :without_followers, -> { left_outer_joins(:follows).where(follows: { id: nil }) }
scope :with_unread_notifications, -> { where(notifications: { already_read: false }) }