From ac5b0b85cee37d58ae3fcd3aa18045656173dfd1 Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Fri, 20 Aug 2021 11:11:20 +0100 Subject: [PATCH] Fixes #3703 - Organization removal does not clear organization_id from Tickets. --- app/models/organization.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/organization.rb b/app/models/organization.rb index 7db54e459..66cf099c1 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -64,7 +64,7 @@ class Organization < ApplicationModel User.where(organization_id: id).find_each do |user| user.update(organization_id: nil) end - Ticket.where(organization_id: id) do |ticket| + Ticket.where(organization_id: id).find_each do |ticket| ticket.update(organization_id: nil) end end