diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index 24981337..7255d9d6 100644 --- a/CHANGELOG.rdoc +++ b/CHANGELOG.rdoc @@ -8,6 +8,10 @@ Notes: https://@plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0 * Allow alternate ORMs to run compatibility setup code before Authenticatable is included (by @jm81) * Do not run validations unless on reconfirmable branch +* enhancements + * allow parent controller to be customizable + * inherit from the same Devise parent controller (by @sj26) + == 2.0.0.rc * enhancements diff --git a/app/controllers/devise_controller.rb b/app/controllers/devise_controller.rb index dcd74cbf..8167cc65 100644 --- a/app/controllers/devise_controller.rb +++ b/app/controllers/devise_controller.rb @@ -1,4 +1,4 @@ # All Devise controllers are inherited from here. -class DeviseController < ApplicationController +class DeviseController < Devise.parent_controller.constantize include Devise::Controllers::InternalHelpers end diff --git a/lib/devise.rb b/lib/devise.rb index 9b6fb5a5..3b1f0801 100644 --- a/lib/devise.rb +++ b/lib/devise.rb @@ -214,6 +214,11 @@ module Devise mattr_accessor :sign_out_via @@sign_out_via = :get + # The parent controller all Devise controllers inherits from. + # Defaults to ApplicationController. + mattr_accessor :parent_controller + @@parent_controller = "ApplicationController" + # DEPRECATED CONFIG # If true, uses salt as remember token and does not create it in the database.