Prevent double hyphens in room names (#2813)

This commit is contained in:
Ahmad Farhat 2021-06-28 22:47:34 -04:00 committed by GitHub
parent f013e2b529
commit 3cec43edc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -159,7 +159,7 @@ class User < ApplicationRecord
def name_chunk
charset = ("a".."z").to_a - %w(b i l o s) + ("2".."9").to_a - %w(5 8)
chunk = name.parameterize[0...3]
chunk = name.parameterize(separator: "")[0...3]
if chunk.empty?
chunk + (0...3).map { charset.to_a[rand(charset.size)] }.join
elsif chunk.length == 1