From 8f1f6b374b69fd6356bdc5561d56f5ca9db9fadd Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 25 Nov 2019 12:06:13 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- rubocop/cop/graphql/authorize_types.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'rubocop') diff --git a/rubocop/cop/graphql/authorize_types.rb b/rubocop/cop/graphql/authorize_types.rb index c69ce10f1c5..7aaa9299362 100644 --- a/rubocop/cop/graphql/authorize_types.rb +++ b/rubocop/cop/graphql/authorize_types.rb @@ -34,7 +34,10 @@ module RuboCop end def whitelisted?(class_node) - return false unless class_node&.const_name + class_const = class_node&.const_name + + return false unless class_const + return true if class_const.end_with?('Enum') WHITELISTED_TYPES.any? { |whitelisted| class_node.const_name.include?(whitelisted) } end -- cgit v1.2.1