There’s a big difference between Host::Managed#managed
that can be true/false, which is what defines whether host is managed or unamanged versus Host::Base
and Host::Managed
classes. The first is abstract class that should never be initiated and clearly we have some bug that allows it to be created.
Oh, this means there’s a relation that’s not automatically cleaned up upon deletion (again because it’s the wrong class). You need to first delete that. Try this
HostFacets::ReportedDataFacet.find_by_host_id(123).destroy
where 123 is the ID of the host you’re trying to delete.