Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Greenlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arbeitsgruppe Hardwarenahe IT-Systeme
Greenlight
Commits
4fb1a008
Commit
4fb1a008
authored
Sep 12, 2018
by
John Ma
Committed by
Jesus Federico
Sep 12, 2018
Browse files
Options
Downloads
Patches
Plain Diff
Fixed #255
* <Fixed how uid was generated> * <Fixed code style> * <Removed unnecessary downcase call>
parent
074a002a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/models/user.rb
+11
-1
11 additions, 1 deletion
app/models/user.rb
with
11 additions
and
1 deletion
app/models/user.rb
+
11
−
1
View file @
4fb1a008
...
...
@@ -92,7 +92,17 @@ class User < ApplicationRecord
end
def
name_chunk
name
[
0
...
3
].
downcase
charset
=
(
"a"
..
"z"
).
to_a
-
%w(b i l o s)
+
(
"2"
..
"9"
).
to_a
-
%w(5 8)
chunk
=
name
.
parameterize
[
0
...
3
]
if
chunk
.
empty?
chunk
+
(
0
...
3
).
map
{
charset
.
to_a
[
rand
(
charset
.
size
)]
}.
join
elsif
chunk
.
length
==
1
chunk
+
(
0
...
2
).
map
{
charset
.
to_a
[
rand
(
charset
.
size
)]
}.
join
elsif
chunk
.
length
==
2
chunk
+
(
0
...
1
).
map
{
charset
.
to_a
[
rand
(
charset
.
size
)]
}.
join
else
chunk
end
end
def
greenlight_account?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment