mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Syntax updates for creator_link and updator_link
This commit is contained in:
parent
d8d951974e
commit
b2ec23edc9
2 changed files with 8 additions and 8 deletions
|
@ -20,7 +20,7 @@ module ApplicationHelper
|
|||
|
||||
def creator_link(model)
|
||||
return 'not present' if model.blank?
|
||||
return model if model.kind_of? String
|
||||
return model if model.is_a? String
|
||||
|
||||
# can be api user or some other user
|
||||
link_to(model.creator, ['admin', model.creator])
|
||||
|
@ -28,7 +28,7 @@ module ApplicationHelper
|
|||
|
||||
def updator_link(model)
|
||||
return 'not present' if model.blank?
|
||||
return model if model.kind_of? String
|
||||
return model if model.is_a? String
|
||||
|
||||
# can be api user or some other user
|
||||
link_to(model.creator, ['admin', model.updator])
|
||||
|
|
|
@ -27,10 +27,10 @@ module Versions
|
|||
def creator
|
||||
return nil if creator_str.blank?
|
||||
|
||||
creator = if creator_str =~ /^\d-api-/
|
||||
ApiUser.find_by(id: creator_str)
|
||||
if creator_str =~ /^\d-api-/
|
||||
creator = ApiUser.find_by(id: creator_str)
|
||||
else
|
||||
AdminUser.find_by(id: creator_str)
|
||||
creator = AdminUser.find_by(id: creator_str)
|
||||
end
|
||||
|
||||
creator.present? ? creator : creator_str
|
||||
|
@ -39,10 +39,10 @@ module Versions
|
|||
def updator
|
||||
return nil if updator_str.blank?
|
||||
|
||||
updator = if updator_str =~ /^\d-api-/
|
||||
ApiUser.find_by(id: updator_str)
|
||||
if updator_str =~ /^\d-api-/
|
||||
updator = ApiUser.find_by(id: updator_str)
|
||||
else
|
||||
AdminUser.find_by(id: updator_str)
|
||||
updator = AdminUser.find_by(id: updator_str)
|
||||
end
|
||||
|
||||
updator.present? ? updator : updator_str
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue