From 37d38d8565a5268a22ce7a80452b73294ae724f3 Mon Sep 17 00:00:00 2001 From: Max Hung Date: Mon, 8 Oct 2018 14:41:11 +1300 Subject: [PATCH] Fix method name clash graphql-ruby v1.8.7 introduced a private method with the same name `apply_scope` in GraphQL::Schema::Field, which happens to be where this module was designed to be prepended to. Close #63 --- lib/graphql-pundit/scope.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/graphql-pundit/scope.rb b/lib/graphql-pundit/scope.rb index 026725e..bc8b570 100644 --- a/lib/graphql-pundit/scope.rb +++ b/lib/graphql-pundit/scope.rb @@ -27,14 +27,14 @@ def after_scope(scope = true) end def resolve_field(obj, args, ctx) - before_scope_return = apply_scope(@before_scope, obj, args, ctx) + before_scope_return = apply_pundit_scope(@before_scope, obj, args, ctx) field_return = super(before_scope_return, args, ctx) - apply_scope(@after_scope, field_return, args, ctx) + apply_pundit_scope(@after_scope, field_return, args, ctx) end private - def apply_scope(scope, root, arguments, context) + def apply_pundit_scope(scope, root, arguments, context) return root unless scope return scope.call(root, arguments, context) if scope.respond_to?(:call)