mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
13 lines
388 B
Ruby
13 lines
388 B
Ruby
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
|