diff options
Diffstat (limited to 'app/graphql/types/work_item_id_type.rb')
-rw-r--r-- | app/graphql/types/work_item_id_type.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/graphql/types/work_item_id_type.rb b/app/graphql/types/work_item_id_type.rb index bb01f865414..777edfad529 100644 --- a/app/graphql/types/work_item_id_type.rb +++ b/app/graphql/types/work_item_id_type.rb @@ -37,7 +37,11 @@ module Types def suitable?(gid) return false if gid&.model_name&.safe_constantize.blank? + # Using === operation doesn't work for model classes. + # See https://github.com/rails/rails/blob/v6.1.6.1/activerecord/lib/active_record/core.rb#L452 + # rubocop:disable Performance/RedundantEqualityComparisonBlock [::WorkItem, ::Issue].any? { |model_class| gid.model_class == model_class } + # rubocop:enable Performance/RedundantEqualityComparisonBlock end private |