Fixes #11188 - EnsureNotUsedBy checks for unscoped associations before destroying
Related issues
Bug #11188: on deleting a capsule: Operation FAILED: ERROR: update or delete on table "smart_proxies" violates foreign key constraint "hosts_puppet_ca_proxy_id_fk" on table "hosts"
Fixes #11188 - EnsureNotUsedBy checks for unscoped associations before destroying