core/rails/app/models/tenant.rb
# when a tenant goes away, we should remove all the deployments and reset the nodes back to system
when a tenant goes away, we should remove all the deployments and reset the nodes back to system
when a tenant goes away we should remove all the deployments and reset the nodes back to system
def tenant_remove_deployments
    Tenant.transaction do
      return true if root?
      root = Tenant.root
      deployments.each do |d|
        d.tenant_id = root.id
        d.save!
      end
      nodes.each do |n|
        n.tenant_id = root.id
        n.save!
      end
    end
  end
def tenant_remove_deployments Tenant . transaction do return true if root? root = Tenant . root deployments . each do | d | d . tenant_id = root . id d . save! end nodes . each do | n | n . tenant_id = root . id n . save! end end end
when a tenant goes away, we should remove all the deployments and reset the nodes back to system
when a tenant goes away we should remove all the deployments and reset the nodes back to system
# don't mess with system tenant # move all deployments to the root tenant # move all nodes to the root tenant