From c3b9f656a6c83e2305360b97ecdb30bd8d4442ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Hal=C3=A1sz?= Date: Tue, 26 Jun 2018 10:45:03 +0200 Subject: [PATCH] Hide quadicon setting for decorators that inherit the quadicon method --- app/helpers/configuration_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/configuration_helper.rb b/app/helpers/configuration_helper.rb index c91ae3b85ee..c737cb26b67 100644 --- a/app/helpers/configuration_helper.rb +++ b/app/helpers/configuration_helper.rb @@ -15,7 +15,7 @@ def compare_decorator_class(a, b) # Returns with a hash of allowed quadicons for the current user def allowed_quadicons MiqDecorator.descendants # Get all the decorator classes - .select { |klass| klass.method_defined?(:quadicon) } # Select only the decorators that define a quadicon + .select { |klass| klass.instance_methods(false).include?(:quadicon) } # Select only the decorators that define a quadicon .sort(&method(:compare_decorator_class)) .map do |decorator| # Get the model name by removing Decorator from the class name