mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 00:42:04 +02:00
Added creator_link and updator_link helpers
This commit is contained in:
parent
15272bad76
commit
d8d951974e
3 changed files with 24 additions and 7 deletions
|
@ -27,21 +27,25 @@ module Versions
|
|||
def creator
|
||||
return nil if creator_str.blank?
|
||||
|
||||
if creator_str =~ /^\d-api-/
|
||||
creator = if creator_str =~ /^\d-api-/
|
||||
ApiUser.find_by(id: creator_str)
|
||||
else
|
||||
AdminUser.find_by(id: creator_str)
|
||||
end
|
||||
|
||||
creator.present? ? creator : creator_str
|
||||
end
|
||||
|
||||
def updator
|
||||
return nil if updator_str.blank?
|
||||
|
||||
if updator_str =~ /^\d-api-/
|
||||
updator = if updator_str =~ /^\d-api-/
|
||||
ApiUser.find_by(id: updator_str)
|
||||
else
|
||||
AdminUser.find_by(id: updator_str)
|
||||
end
|
||||
|
||||
updator.present? ? updator : updator_str
|
||||
end
|
||||
|
||||
# callbacks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue