From f0d0bfc4279c5f0cb7d70fb528b1298a55bdfd14 Mon Sep 17 00:00:00 2001 From: JC Date: Mon, 26 Dec 2016 17:55:31 +0100 Subject: [PATCH] Listing updated champs, saving only champs changed --- app/services/champs_service.rb | 4 ++-- .../_left_panel_backoffice_dossierscontroller_show.html.haml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/champs_service.rb b/app/services/champs_service.rb index faf25cf7c..04fdf9602 100644 --- a/app/services/champs_service.rb +++ b/app/services/champs_service.rb @@ -19,9 +19,9 @@ class ChampsService end end - champ.save + champ.save if champ.changed? end errors end -end \ No newline at end of file +end diff --git a/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.html.haml index f8164b27a..b424cc9d6 100644 --- a/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.html.haml +++ b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.html.haml @@ -40,7 +40,7 @@ .updated-at= notification.updated_at.strftime('%d/%m/%Y %H:%M') - if ['champs', 'piece_justificative'].include?(notification.type_notif) - if notification.liste.size > 1 - .type= "Plusieurs attributs ont été changés, dont: #{notification.liste.last}" + .type= "Plusieurs attributs ont été changés, dont: #{notification.liste.join(" ")}" - else .type= "Un attribut à été changé: #{notification.liste.last}" - else