diff options
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6635a3f..d1623af 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -5,6 +5,16 @@ class ApplicationController < ActionController::Base helper :all # include all helpers, all the time protect_from_forgery # See ActionController::RequestForgeryProtection for details + append_before_filter :only_valid_users + # Scrub sensitive parameters from your log # filter_parameter_logging :password + + protected + def only_valid_users + unless current_user.valid? + flash[:notice] = "You user account is invalid, please fix problems before you continue." + redirect_to edit_user_path(current_user) + end + end end |