Class: Devise::Delegator

Inherits:
Object
  • Object
show all
Defined in:
lib/devise/delegator.rb

Overview

Checks the scope in the given environment and returns the associated failure app.

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



4
5
6
# File 'lib/devise/delegator.rb', line 4

def call(env)
  failure_app(env).call(env)
end

#failure_app(env) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/devise/delegator.rb', line 8

def failure_app(env)
  app = env["warden.options"] &&
    (scope = env["warden.options"][:scope]) &&
    Devise.mappings[scope.to_sym].failure_app

  app || Devise::FailureApp
end