23 lines
611 B
Ruby
23 lines
611 B
Ruby
# frozen_string_literal: true
|
||
|
||
class Champs::PieceJustificativeChamp < Champ
|
||
FILE_MAX_SIZE = 200.megabytes
|
||
|
||
has_many_attached :piece_justificative_file
|
||
|
||
validates :piece_justificative_file,
|
||
size: { less_than: FILE_MAX_SIZE },
|
||
if: -> { can_validate? && !type_de_champ.skip_pj_validation }
|
||
|
||
validates :piece_justificative_file,
|
||
content_type: AUTHORIZED_CONTENT_TYPES,
|
||
if: -> { can_validate? && !type_de_champ.skip_content_type_pj_validation }
|
||
|
||
def main_value_name
|
||
:piece_justificative_file
|
||
end
|
||
|
||
def search_terms
|
||
# We don’t know how to search inside documents yet
|
||
end
|
||
end
|