ManageIQ/manageiq-ui-classic

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

Summary

Maintainability
A
35 mins
Test Coverage
A
100%
class ApplicationHelper::Button::HostFeatureButtonWithDisable < ApplicationHelper::Button::GenericFeatureButtonWithDisable
  def visible?
    # TODO: @feature.nil? || @record.nil? || !@record.kind_of?(Host) || @record.supports?(@feature.to_sym)
    unless @feature.nil? || @record.nil?
      return false if @record.kind_of?(ManageIQ::Providers::Openstack::InfraManager)
      return @record.supports?(@feature.to_sym) if @record.kind_of?(ManageIQ::Providers::Openstack::InfraManager::Host)
    end
    true
  end

  def disabled?
    false
  end
end