Add deleted_at for User

Do not remove the user from the database. Mark as deleted instead.
This commit is contained in:
Patrick Gansterer 2016-03-04 19:03:52 +01:00
parent b30b4e46d8
commit b05ac2ab64
15 changed files with 82 additions and 12 deletions

View file

@ -20,7 +20,7 @@ class ApplicationController < ActionController::Base
# check if there is a valid session and return the logged-in user (its object)
if session[:user_id] && params[:foodcoop]
# for shared-host installations. check if the cookie-subdomain fits to request.
@current_user ||= User.find_by_id(session[:user_id]) if session[:scope] == FoodsoftConfig.scope
@current_user ||= User.undeleted.find_by_id(session[:user_id]) if session[:scope] == FoodsoftConfig.scope
end
end
helper_method :current_user