ManageIQ/manageiq-ui-classic

View on GitHub
app/helpers/application_helper/button/storage_delete.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
class ApplicationHelper::Button::StorageDelete < ApplicationHelper::Button::Basic
  needs :@record

  def disabled?
    unless @record.vms_and_templates.empty? && @record.hosts.empty?
      @error_message = _('Only Datastore without VMs and Hosts can be removed')
    end
    @error_message.present?
  end
end