From 622ff7c364afd0847942f00bffae203278a2776d Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Wed, 9 Oct 2024 12:24:42 +0100 Subject: [PATCH] Revert "Prevent duplicate rent periods v1" This reverts commit bb3b4070 --- app/services/merge/merge_organisations_service.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/services/merge/merge_organisations_service.rb b/app/services/merge/merge_organisations_service.rb index 848efb13f..bcaad85a6 100644 --- a/app/services/merge/merge_organisations_service.rb +++ b/app/services/merge/merge_organisations_service.rb @@ -38,9 +38,7 @@ private def merge_rent_periods(merging_organisation) merging_organisation.rent_periods.each do |rent_period| - unless @absorbing_organisation.organisation_rent_periods.exists?(rent_period:) - @absorbing_organisation.organisation_rent_periods << OrganisationRentPeriod.new(rent_period:) - end + @absorbing_organisation.organisation_rent_periods << OrganisationRentPeriod.new(rent_period:) unless @absorbing_organisation.rent_periods.include?(rent_period) end end