From ea14d003ce8f3775b16d4098aae0f894406496c6 Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Thu, 3 Aug 2023 15:43:28 +0100 Subject: [PATCH] feat: tidy up active readouts --- app/models/form/lettings/questions/stock_owner.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/models/form/lettings/questions/stock_owner.rb b/app/models/form/lettings/questions/stock_owner.rb index bc0c7f7ed..c99f32ea0 100644 --- a/app/models/form/lettings/questions/stock_owner.rb +++ b/app/models/form/lettings/questions/stock_owner.rb @@ -27,13 +27,7 @@ class Form::Lettings::Questions::StockOwner < ::Form::Question Organisation.where(holds_own_stock: true).pluck(:id, :name).to_h else stock_owners = user.organisation.stock_owners - .map { |stock_owner| - # if user.organisation.absorbed_organisations.find { |absorbed_org| absorbed_org.stock_owners.include?(stock_owner) }.present? - # [stock_owner.id, "#{stock_owner.name} (Active as of #{user.organisation.absorbed_organisations.find { |absorbed_org| absorbed_org.stock_owners.include?(stock_owner) }.merge_date})"] - # else - [stock_owner.id, stock_owner.name] - # end - }.to_h + .map { |stock_owner| [stock_owner.id, stock_owner.name] }.to_h absorbed_stock_owning_orgs = user.organisation.absorbed_organisations .where(holds_own_stock: true) .map { |org| [org.id, "#{org.name} (Inactive as of #{org.merge_date.to_time.to_formatted_s(:govuk_date)})"] }.to_h