This commit is contained in:
Yan
2017-10-12 15:34:16 +06:30
parent b7955b04fa
commit a6b8389fd0
4 changed files with 25 additions and 22 deletions

View File

@@ -12,11 +12,6 @@ class ApplicationController < ActionController::Base
#all token authentication must be done here
#response format must be set to JSON
rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message
redirect_to root_path
end
def set_locale
I18n.locale = params[:locale] || I18n.default_locale
end
@@ -72,6 +67,11 @@ class ApplicationController < ActionController::Base
@default_config ||= ActiveRecord::Base.connection.instance_variable_get("@config").dup
end
rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message
redirect_to root_path
end
def current_user
@current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token]
end