Skip to content

Commit

Permalink
fix: more reliable check of module is included (#1418)
Browse files Browse the repository at this point in the history
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?'
```
  • Loading branch information
bf4 authored Oct 27, 2023
1 parent bdce601 commit 81e4ecf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tasks/check_upgrade.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 81e4ecf

Please sign in to comment.