From 2b64c6d9515126ec729ba700dcd75d5dfa053f51 Mon Sep 17 00:00:00 2001 From: Samuel Cochran Date: Sat, 25 Jun 2011 03:34:13 +0800 Subject: [PATCH] Make all controllers inherit from a single DeviseController --- app/controllers/devise/confirmations_controller.rb | 2 +- app/controllers/devise/omniauth_callbacks_controller.rb | 2 +- app/controllers/devise/passwords_controller.rb | 2 +- app/controllers/devise/registrations_controller.rb | 2 +- app/controllers/devise/sessions_controller.rb | 2 +- app/controllers/devise/unlocks_controller.rb | 2 +- app/controllers/devise_controller.rb | 3 +++ 7 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 app/controllers/devise_controller.rb diff --git a/app/controllers/devise/confirmations_controller.rb b/app/controllers/devise/confirmations_controller.rb index 98a1cd7b..901946c6 100644 --- a/app/controllers/devise/confirmations_controller.rb +++ b/app/controllers/devise/confirmations_controller.rb @@ -1,4 +1,4 @@ -class Devise::ConfirmationsController < ApplicationController +class Devise::ConfirmationsController < DeviseController include Devise::Controllers::InternalHelpers # GET /resource/confirmation/new diff --git a/app/controllers/devise/omniauth_callbacks_controller.rb b/app/controllers/devise/omniauth_callbacks_controller.rb index 32bd086e..db8bbcb5 100644 --- a/app/controllers/devise/omniauth_callbacks_controller.rb +++ b/app/controllers/devise/omniauth_callbacks_controller.rb @@ -1,4 +1,4 @@ -class Devise::OmniauthCallbacksController < ApplicationController +class Devise::OmniauthCallbacksController < DeviseController include Devise::Controllers::InternalHelpers def failure diff --git a/app/controllers/devise/passwords_controller.rb b/app/controllers/devise/passwords_controller.rb index b0f8acc0..e106b663 100644 --- a/app/controllers/devise/passwords_controller.rb +++ b/app/controllers/devise/passwords_controller.rb @@ -1,4 +1,4 @@ -class Devise::PasswordsController < ApplicationController +class Devise::PasswordsController < DeviseController prepend_before_filter :require_no_authentication include Devise::Controllers::InternalHelpers diff --git a/app/controllers/devise/registrations_controller.rb b/app/controllers/devise/registrations_controller.rb index 835a8607..72d25be8 100644 --- a/app/controllers/devise/registrations_controller.rb +++ b/app/controllers/devise/registrations_controller.rb @@ -1,4 +1,4 @@ -class Devise::RegistrationsController < ApplicationController +class Devise::RegistrationsController < DeviseController prepend_before_filter :require_no_authentication, :only => [ :new, :create, :cancel ] prepend_before_filter :authenticate_scope!, :only => [:edit, :update, :destroy] include Devise::Controllers::InternalHelpers diff --git a/app/controllers/devise/sessions_controller.rb b/app/controllers/devise/sessions_controller.rb index d7074f67..6c56c494 100644 --- a/app/controllers/devise/sessions_controller.rb +++ b/app/controllers/devise/sessions_controller.rb @@ -1,4 +1,4 @@ -class Devise::SessionsController < ApplicationController +class Devise::SessionsController < DeviseController prepend_before_filter :require_no_authentication, :only => [ :new, :create ] include Devise::Controllers::InternalHelpers diff --git a/app/controllers/devise/unlocks_controller.rb b/app/controllers/devise/unlocks_controller.rb index 15933cd6..95a89e67 100644 --- a/app/controllers/devise/unlocks_controller.rb +++ b/app/controllers/devise/unlocks_controller.rb @@ -1,4 +1,4 @@ -class Devise::UnlocksController < ApplicationController +class Devise::UnlocksController < DeviseController prepend_before_filter :require_no_authentication include Devise::Controllers::InternalHelpers diff --git a/app/controllers/devise_controller.rb b/app/controllers/devise_controller.rb new file mode 100644 index 00000000..e375f5d5 --- /dev/null +++ b/app/controllers/devise_controller.rb @@ -0,0 +1,3 @@ +# All Devise controllers are inherited from here. +class DeviseController < ApplicationController +end