instructeurs can create and download archives

This commit is contained in:
Christophe Robillard 2021-03-30 10:46:21 +02:00
parent 609a1aa45b
commit 8b2849408c
10 changed files with 229 additions and 0 deletions

View file

@ -156,6 +156,20 @@ class Procedure < ApplicationRecord
includes(:draft_revision, :published_revision, administrateurs: :user)
}
scope :for_download, -> {
includes(
:groupe_instructeurs,
dossiers: {
champs: [
piece_justificative_file_attachment: :blob,
champs: [
piece_justificative_file_attachment: :blob
]
]
}
)
}
validates :libelle, presence: true, allow_blank: false, allow_nil: false
validates :description, presence: true, allow_blank: false, allow_nil: false
validates :administrateurs, presence: true