Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace validate_destroy with supports feature #21073

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions app/models/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ class Host < ApplicationRecord
before_create :make_smart
after_save :process_events

supports :destroy
supports :reset do
unsupported_reason_add(:reset, _("The Host is not configured for IPMI")) if ipmi_address.blank?
unsupported_reason_add(:reset, _("The Host has no IPMI credentials")) if authentication_type(:ipmi).nil?
Expand Down Expand Up @@ -1728,10 +1729,6 @@ def normalized_state
"unknown"
end

def validate_destroy
{:available => true, :message => nil}
end

def self.display_name(number = 1)
n_('Host', 'Hosts', number)
end
Expand Down