From 95437c69a44ec399383d7762f2b46a6472255d6a Mon Sep 17 00:00:00 2001 From: Giga Chubinidze Date: Thu, 8 Jun 2023 12:54:01 +0400 Subject: [PATCH] included name --- app/models/concerns/archivable_model.rb | 4 +++- app/views/my_modules/protocols/_protocol_status_bar.html.erb | 2 +- config/locales/en.yml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/concerns/archivable_model.rb b/app/models/concerns/archivable_model.rb index 7e15eeac8..0a9fb2f18 100644 --- a/app/models/concerns/archivable_model.rb +++ b/app/models/concerns/archivable_model.rb @@ -50,7 +50,9 @@ module ArchivableModel def name_with_label raise NotImplementedError, "Archivable model must implement the '.archived_branch?' method!" unless respond_to?(:archived_branch?) - I18n.t("labels.archived") if self.archived_branch? + return (parent&.name || name).prepend(I18n.t("labels.archived")) if archived_branch? + + parent&.name || name end protected diff --git a/app/views/my_modules/protocols/_protocol_status_bar.html.erb b/app/views/my_modules/protocols/_protocol_status_bar.html.erb index d2549b317..e695072c6 100644 --- a/app/views/my_modules/protocols/_protocol_status_bar.html.erb +++ b/app/views/my_modules/protocols/_protocol_status_bar.html.erb @@ -18,7 +18,7 @@