Fixes #19631 - ComputeResource with KeyPair can be removed
The concern for removing the compute resources with keypairs was trying to destroy the compute resource too early. Also, this deletion already happened because of the has_one :dependency => :destroy relation
This fixes the problem and adds tests to ensure the relation works.
Related issues
Bug #19631: ActiveRecord::RecordNotSaved when deleting compute resources with key pairs
Fixes #19631 - ComputeResource with KeyPair can be removed
The concern for removing the compute resources with keypairs was trying
to destroy the compute resource too early. Also, this deletion already
happened because of the has_one :dependency => :destroy relation
This fixes the problem and adds tests to ensure the relation works.