Class: Ibrain::Mutations::AuthMutation

Inherits:
BaseMutation
  • Object
show all
Includes:
ActionController::Helpers, Devise::Controllers::Helpers, Devise::Controllers::ScopedViews
Defined in:
app/graphql/ibrain/mutations/auth_mutation.rb

Instance Method Summary collapse

Instance Method Details

#_prefixesObject

Override prefixes to consider the scoped view. Notice we need to check for the request due to a bug in Action Controller tests that forces _prefixes to be loaded before even having a request object.

This method should be public as it is in ActionPack itself. Changing its visibility may break other gems.



30
31
32
33
34
35
36
# File 'app/graphql/ibrain/mutations/auth_mutation.rb', line 30

def _prefixes # :nodoc:
  @_prefixes ||= if self.class.scoped_views? && request && devise_mapping
    ["#{devise_mapping.scoped_path}/#{controller_name}"] + super
  else
    super
  end
end

#ready?(args) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
21
# File 'app/graphql/ibrain/mutations/auth_mutation.rb', line 14

def ready?(args)
  @params = ActionController::Parameters.new(
    args.to_h.with_indifferent_access.transform_keys(&:underscore)
  )

  @auth_resource = load_resource
  true
end