diff --git a/app/models/organisation.rb b/app/models/organisation.rb index 441d67ad6..ae6bc3b4d 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -217,7 +217,7 @@ class Organisation < ApplicationRecord start_date: created_at, end_date: changes.first&.dig(:start_date)&.yesterday, status: changes.empty? ? "active" : "inactive", - ) + ) changes end diff --git a/app/models/organisation_name_change.rb b/app/models/organisation_name_change.rb index 6df115dff..f0bf5f674 100644 --- a/app/models/organisation_name_change.rb +++ b/app/models/organisation_name_change.rb @@ -36,7 +36,7 @@ class OrganisationNameChange < ApplicationRecord end def includes_date?(date) - startdate <= date && (next_change&.startdate.nil? || next_change&.startdate > date) + startdate <= date && (!next_change&.startdate || next_change.startdate > date) end def next_change