From 72af8fd4b8d8f235b02346579442fe3e3b2cb1d0 Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Sun, 22 Oct 2023 16:36:22 -0500 Subject: [PATCH] fix: more reliable check of module is included handle gems like GraphQL which override `include?` ``` rake aborted! ArgumentError: wrong number of arguments (given 1, expected 3) gems/graphql-2.0.13/lib/graphql/schema/directive.rb:58:in `include?' ``` --- lib/tasks/check_upgrade.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/check_upgrade.rake b/lib/tasks/check_upgrade.rake index 869f04e2..41cb8e0f 100644 --- a/lib/tasks/check_upgrade.rake +++ b/lib/tasks/check_upgrade.rake @@ -9,7 +9,7 @@ namespace :jsonapi do task :check_upgrade => :environment do Rails.application.eager_load! - resource_klasses = ObjectSpace.each_object(Class).select { |klass| klass.include?(JSONAPI::ResourceCommon)} + resource_klasses = ObjectSpace.each_object(Class).select { |klass| klass.included_modules.include?(JSONAPI::ResourceCommon)} puts "Checking #{resource_klasses.count} resources"