2018-10-22 03:00:50 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-15 08:59:37 -04:00
|
|
|
module Gitlab
|
|
|
|
module GlId
|
|
|
|
def self.gl_id(user)
|
|
|
|
if user.present?
|
2018-04-18 13:50:56 -04:00
|
|
|
gl_id_from_id_value(user.id)
|
2016-06-15 08:59:37 -04:00
|
|
|
else
|
2018-04-18 13:50:56 -04:00
|
|
|
''
|
2016-06-15 08:59:37 -04:00
|
|
|
end
|
|
|
|
end
|
2018-04-18 13:50:56 -04:00
|
|
|
|
|
|
|
def self.gl_id_from_id_value(id)
|
|
|
|
"user-#{id}"
|
|
|
|
end
|
2016-06-15 08:59:37 -04:00
|
|
|
end
|
|
|
|
end
|