mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 02:39:37 +02:00
Whodunnit helper to distinguish user from epp_user
This commit is contained in:
parent
af97dadfca
commit
b5608c1394
6 changed files with 23 additions and 5 deletions
13
app/helpers/whodunnit_helper.rb
Normal file
13
app/helpers/whodunnit_helper.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
module WhodunnitHelper
|
||||
def link_to_whodunnit(whodunnit)
|
||||
return nil unless whodunnit
|
||||
if whodunnit.include?('-EppUser')
|
||||
user = EppUser.find(whodunnit)
|
||||
return link_to(user.username, admin_epp_user_path(user))
|
||||
end
|
||||
user = User.find(whodunnit)
|
||||
return link_to(user.username, admin_user_path(user))
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
return nil
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue