-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use import_methods instead of include in refinements if available. #3674
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update here. Interesting change in Ruby.
lib/graphql/deprecated_dsl.rb
Outdated
TYPE_CLASSES.each do |type_class| | ||
refine type_class.singleton_class do | ||
include Methods | ||
if Refinement.private_method_defined?(:import_methods) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if Refinement.private_method_defined?(:import_methods) | |
if defined?(::Refinement) && Refinement.private_method_defined?(:import_methods) |
It looks like Refinement
was added in the patch you linked earlier: ruby/ruby@6606597#diff-ddea6b44375166521cc45b79d4c54b08594c13872acc5ec279f07d2eda8c32baR684 Judging by CI failures, I guess we should check if it exists first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed 🤦
Ruby 3.1 deprecate the use of include/prepend inside refienements Ref: https://bugs.ruby-lang.org/issues/17429
8625f01
to
ddce9dc
Compare
Thanks for the fix! |
to add support for Ruby 3.2 related to the use of include in refinements as fixed in this PR: rmosolgo/graphql-ruby#3674
Ruby 3.1 deprecate the use of include/prepend inside refinements
Ref: https://bugs.ruby-lang.org/issues/17429