From 912ad58b20bb46bdd9784dfe0b145765d58a779d Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Mon, 22 Feb 2021 16:11:33 -0500 Subject: [PATCH] Replace Host.validate_destroy with supports feature --- app/controllers/mixins/actions/host_actions/misc.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/mixins/actions/host_actions/misc.rb b/app/controllers/mixins/actions/host_actions/misc.rb index 739903c868a..2e041673d72 100644 --- a/app/controllers/mixins/actions/host_actions/misc.rb +++ b/app/controllers/mixins/actions/host_actions/misc.rb @@ -34,9 +34,8 @@ def process_hosts_refresh(hosts, task, display_name) def process_hosts_destroy(hosts, display_name) each_host(hosts, display_name) do |host| - validation = host.validate_destroy - if !validation[:available] - add_flash(validation[:message], :error) + if !host.supports?(:destroy) + add_flash(host.unsupported_reason(:destroy), :error) else audit = {:event => "host_record_delete_initiated", :message => "[#{host.name}] Record delete initiated",