|
|
|
@ -70,7 +70,7 @@ private |
|
|
|
|
|
|
|
|
|
|
|
new_scheme = Scheme.create!(scheme.attributes.except("id", "owning_organisation_id").merge(owning_organisation: @absorbing_organisation)) |
|
|
|
new_scheme = Scheme.create!(scheme.attributes.except("id", "owning_organisation_id").merge(owning_organisation: @absorbing_organisation)) |
|
|
|
scheme.locations.each do |location| |
|
|
|
scheme.locations.each do |location| |
|
|
|
new_scheme.locations << Location.new(location.attributes.except("id", "scheme_id")) unless location.deactivated? |
|
|
|
new_scheme.locations << Location.new(location.attributes.except("id", "scheme_id", "old_id")) unless location.deactivated? |
|
|
|
end |
|
|
|
end |
|
|
|
@merged_schemes[merging_organisation.name] << { name: new_scheme.service_name, code: new_scheme.id } |
|
|
|
@merged_schemes[merging_organisation.name] << { name: new_scheme.service_name, code: new_scheme.id } |
|
|
|
SchemeDeactivationPeriod.create!(scheme:, deactivation_date: @merge_date) |
|
|
|
SchemeDeactivationPeriod.create!(scheme:, deactivation_date: @merge_date) |
|
|
|
|