This commit is contained in:
vilet.yy 2021-06-11 14:54:24 +08:00
parent 672f37fe48
commit 1376e004f2
1 changed files with 1 additions and 13 deletions

View File

@ -1,5 +1,5 @@
module Dcodes
DCODES = %W(1 2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R ST UV W X Y Z)
DCODES = %W(1 2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
extend ActiveSupport::Concern
@ -11,16 +11,4 @@ module Dcodes
code
end
def init_project_invite_code
total_count = Project.where(invite_code: nil).size
limit = 100
page = 1
while page * limit > total_count do
bulk_arr = []
(1..100).each do |_|
bulk_arr < DCODES.sample(6).join
end
end
end
end