diff --git a/app/models/location.rb b/app/models/location.rb
index 0fdc24a8e..874d26245 100644
--- a/app/models/location.rb
+++ b/app/models/location.rb
@@ -2,6 +2,7 @@ class Location < ApplicationRecord
validate :validate_postcode
validates :units, :type_of_unit, :mobility_type, presence: true
belongs_to :scheme
+ has_many :lettings_logs, class_name: "LettingsLog"
has_paper_trail
diff --git a/app/views/locations/toggle_active_confirm.html.erb b/app/views/locations/toggle_active_confirm.html.erb
index 8bf8722a2..474e36454 100644
--- a/app/views/locations/toggle_active_confirm.html.erb
+++ b/app/views/locations/toggle_active_confirm.html.erb
@@ -4,7 +4,7 @@
<% end %>
<%= @scheme.service_name %>
- <%= "This change will affect SOME logs" %>
+ <%= "This change will affect #{@location.lettings_logs.count} logs" %>
<%= govuk_warning_text text: I18n.t("warnings.location.deactivation.review_logs") %>
<%= f.hidden_field :confirm, :value => true %>
diff --git a/spec/requests/locations_controller_spec.rb b/spec/requests/locations_controller_spec.rb
index e74ffb691..80213a73f 100644
--- a/spec/requests/locations_controller_spec.rb
+++ b/spec/requests/locations_controller_spec.rb
@@ -1253,7 +1253,7 @@ RSpec.describe LocationsController, type: :request do
it "renders the confirmation page" do
expect(response).to have_http_status(:ok)
- expect(page).to have_content("This change will affect SOME logs")
+ expect(page).to have_content("This change will affect #{location.lettings_logs.count} logs")
end
end
@@ -1262,7 +1262,7 @@ RSpec.describe LocationsController, type: :request do
it "renders the confirmation page" do
expect(response).to have_http_status(:ok)
- expect(page).to have_content("This change will affect SOME logs")
+ expect(page).to have_content("This change will affect #{location.lettings_logs.count} logs")
end
end