Problem description:
I have imported some (>1000) organizations in a test environment and would now like to delete them in order to be able to import them again.
I have tried it in the rails console, but it only works for a maximum of 2 organizations
organizations = Organization.where(‘name LIKE ?’, ‘3%’)
organizations.each do |org|
org.members.each do |member|
member.update!(organization_id: nil)
end
org.destroy
end