mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 05:05:45 +02:00
Supply PaperTrail with current user
This commit is contained in:
parent
6f0c886236
commit
f1cbdec8e7
3 changed files with 5 additions and 5 deletions
|
@ -32,8 +32,4 @@ class ApplicationController < ActionController::Base
|
||||||
def available_languages
|
def available_languages
|
||||||
{ en: 'English', et: 'Estonian' }.invert
|
{ en: 'English', et: 'Estonian' }.invert
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_for_paper_trail
|
|
||||||
current_user.present? ? current_user.id_role_username : 'public'
|
|
||||||
end
|
|
||||||
end
|
end
|
|
@ -105,4 +105,8 @@ class Registrant::SessionsController < Devise::SessionsController
|
||||||
def after_sign_out_path_for(_resource_or_scope)
|
def after_sign_out_path_for(_resource_or_scope)
|
||||||
new_registrant_user_session_path
|
new_registrant_user_session_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def user_for_paper_trail
|
||||||
|
current_registrant_user.present? ? current_registrant_user.id_role_username : 'guest'
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -17,6 +17,6 @@ class RegistrantController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_for_paper_trail
|
def user_for_paper_trail
|
||||||
current_registrant_user.present? ? current_registrant_user.id_role_username : 'public'
|
current_registrant_user.present? ? current_registrant_user.id_role_username : 'guest'
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Add table
Add a link
Reference in a new issue