mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +02:00
Version refactored
This commit is contained in:
parent
c1949e7069
commit
3e2be53853
48 changed files with 379 additions and 147 deletions
|
@ -16,13 +16,23 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
def user_for_paper_trail
|
||||
if defined?(current_api_user) && current_api_user.present?
|
||||
"#{current_api_user.id}-api-#{current_api_user.username}"
|
||||
# Most of the time it's not loaded in correct time because PaperTrail before filter kicks in
|
||||
# before current_api_user is defined. PaperTrail is triggered also at current_api_user
|
||||
api_user_log_str(current_api_user)
|
||||
elsif current_user.present?
|
||||
"#{current_user.id}-#{current_user.username}"
|
||||
else
|
||||
'public'
|
||||
end
|
||||
end
|
||||
|
||||
def api_user_log_str(user)
|
||||
if user.present?
|
||||
"#{user.id}-api-#{user.username}"
|
||||
else
|
||||
'api-public'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue