From 780cbd9ba9e1f259041146251f2321a6d1876b00 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Mon, 25 Nov 2024 16:38:51 +0000 Subject: [PATCH] Fix references to scheme organisation --- app/helpers/schemes_helper.rb | 4 ++-- app/views/locations/index.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/schemes_helper.rb b/app/helpers/schemes_helper.rb index 4d95bef8a..abb7ff9c3 100644 --- a/app/helpers/schemes_helper.rb +++ b/app/helpers/schemes_helper.rb @@ -84,11 +84,11 @@ module SchemesHelper when :deactivating_soon "This scheme deactivates on #{scheme.last_deactivation_date.to_formatted_s(:govuk_date)}. Any locations you add will be deactivated on the same date. Reactivate the scheme to add locations active after this date." when :deactivated - case scheme.organisation.status + case scheme.owning_organisation.status when :active "This scheme deactivated on #{scheme.last_deactivation_date.to_formatted_s(:govuk_date)}. Any locations you add will be deactivated on the same date. Reactivate the scheme to add locations active after this date." when :merged - "This scheme has been deactivated due to its organisation merging on #{scheme.organisation.merge_date.to_formatted_s(:govuk_date)}. Any locations you add will be deactivated on the same date. Use the new (after merge) organisation for schemes and locations active after this date." + "This scheme has been deactivated due to #{scheme.owning_organisation.name} merging into #{scheme.owning_organisation.absorbing_organisation.name} on #{scheme.owning_organisation.merge_date.to_formatted_s(:govuk_date)}. Any locations you add will be deactivated on the same date. Use the after merge organisation for schemes and locations active after this date." end end end diff --git a/app/views/locations/index.html.erb b/app/views/locations/index.html.erb index aa1fa6253..23550f894 100644 --- a/app/views/locations/index.html.erb +++ b/app/views/locations/index.html.erb @@ -56,7 +56,7 @@ <% end %> <% end %> - <% if LocationPolicy.new(current_user, @scheme.locations.new).create? && [:active, :merged].include?(@scheme.organisation.status) %> + <% if LocationPolicy.new(current_user, @scheme.locations.new).create? && [:active, :merged].include?(@scheme.owning_organisation.status) %> <% if status_hint_message = scheme_status_hint(@scheme) %>
<%= status_hint_message %>