mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +02:00
Added current_user for papertrail
This commit is contained in:
parent
aebe137978
commit
1591d6a7b4
5 changed files with 29 additions and 22 deletions
|
@ -13,6 +13,16 @@ class ApplicationController < ActionController::Base
|
|||
return session[:user_return_to].to_s if session[:user_return_to] && session[:user_return_to] != login_path
|
||||
admin_dashboard_path
|
||||
end
|
||||
|
||||
def user_for_paper_trail
|
||||
if defined?(current_api_user) && current_api_user.present?
|
||||
"#{current_api_user.id}-api-#{current_api_user.username}"
|
||||
elsif current_user.present?
|
||||
"#{current_user.id}-#{current_user.username}"
|
||||
else
|
||||
'public'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue