From 54bcc829c0b39bac088335736569475340b0aba8 Mon Sep 17 00:00:00 2001 From: Xavier J Date: Tue, 3 Jan 2017 15:12:49 +0100 Subject: [PATCH] Fix commentaire PJ bug --- app/models/piece_justificative.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/models/piece_justificative.rb b/app/models/piece_justificative.rb index 0c2056b6a..c9537adf0 100644 --- a/app/models/piece_justificative.rb +++ b/app/models/piece_justificative.rb @@ -19,6 +19,14 @@ class PieceJustificative < ActiveRecord::Base content.blank? end + def libelle + if type_de_piece_justificative.nil? + return content.to_s + else + type_de_piece_justificative.libelle + end + end + def content_url unless content.url.nil? if Features.remote_storage