module GraphQL::Pundit::Common

Common methods used for authorization and scopes

Public Class Methods

included(base) click to toggle source
# File lib/graphql-pundit/common.rb, line 15
def self.included(base)
  @current_user = :current_user
  base.extend(ClassMethods)
end

Public Instance Methods

callable?(thing) click to toggle source
# File lib/graphql-pundit/common.rb, line 20
def callable?(thing)
  thing.respond_to?(:call)
end
model?(thing) click to toggle source
# File lib/graphql-pundit/common.rb, line 24
def model?(thing)
  thing.respond_to?(:model)
end