ManageIQ/manageiq-ui-classic

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

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
class ApplicationHelper::Button::InstanceCheckCompare < ApplicationHelper::Button::Basic
  def visible?
    !@record.kind_of?(OrchestrationStack) || @display != 'instances'
  end

  def disabled?
    @error_message = _('No Compliance Policies assigned to this virtual machine') unless
        @record.try(:has_compliance_policies?)
    @record.present? && @error_message.present?
  end
end