refactor(dossier): remove unused scopes
This commit is contained in:
parent
3817f334c9
commit
ed4fbc887a
2 changed files with 8 additions and 39 deletions
|
@ -270,26 +270,9 @@ class Dossier < ApplicationRecord
|
||||||
scope :en_cours, -> { not_archived.state_en_construction_ou_instruction }
|
scope :en_cours, -> { not_archived.state_en_construction_ou_instruction }
|
||||||
scope :without_followers, -> { where.missing(:follows) }
|
scope :without_followers, -> { where.missing(:follows) }
|
||||||
scope :with_followers, -> { left_outer_joins(:follows).where.not(follows: { id: nil }) }
|
scope :with_followers, -> { left_outer_joins(:follows).where.not(follows: { id: nil }) }
|
||||||
scope :with_champs, -> {
|
|
||||||
includes(champs_public: [
|
|
||||||
:geo_areas,
|
|
||||||
piece_justificative_file_attachments: :blob,
|
|
||||||
champs: [piece_justificative_file_attachments: :blob]
|
|
||||||
])
|
|
||||||
}
|
|
||||||
|
|
||||||
scope :brouillons_recently_updated, -> { updated_since(2.days.ago).state_brouillon.order_by_updated_at }
|
scope :brouillons_recently_updated, -> { updated_since(2.days.ago).state_brouillon.order_by_updated_at }
|
||||||
scope :with_annotations, -> {
|
|
||||||
includes(champs_private: [
|
|
||||||
:geo_areas,
|
|
||||||
piece_justificative_file_attachments: :blob,
|
|
||||||
champs: [piece_justificative_file_attachments: :blob]
|
|
||||||
])
|
|
||||||
}
|
|
||||||
scope :for_api, -> {
|
scope :for_api, -> {
|
||||||
with_champs
|
includes(commentaires: { piece_jointe_attachments: :blob },
|
||||||
.with_annotations
|
|
||||||
.includes(commentaires: { piece_jointe_attachments: :blob },
|
|
||||||
justificatif_motivation_attachment: :blob,
|
justificatif_motivation_attachment: :blob,
|
||||||
attestation: [],
|
attestation: [],
|
||||||
avis: { piece_justificative_file_attachment: :blob },
|
avis: { piece_justificative_file_attachment: :blob },
|
||||||
|
|
|
@ -209,20 +209,6 @@ class Procedure < ApplicationRecord
|
||||||
includes(:draft_revision, :published_revision, administrateurs: :user)
|
includes(:draft_revision, :published_revision, administrateurs: :user)
|
||||||
}
|
}
|
||||||
|
|
||||||
scope :for_download, -> {
|
|
||||||
includes(
|
|
||||||
:groupe_instructeurs,
|
|
||||||
dossiers: {
|
|
||||||
champs_public: [
|
|
||||||
piece_justificative_file_attachments: :blob,
|
|
||||||
champs: [
|
|
||||||
piece_justificative_file_attachments: :blob
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
validates :libelle, presence: true, allow_blank: false, allow_nil: false
|
validates :libelle, presence: true, allow_blank: false, allow_nil: false
|
||||||
validates :description, presence: true, allow_blank: false, allow_nil: false
|
validates :description, presence: true, allow_blank: false, allow_nil: false
|
||||||
validates :administrateurs, presence: true
|
validates :administrateurs, presence: true
|
||||||
|
|
Loading…
Reference in a new issue