修复邀请码会变的问题
This commit is contained in:
parent
436de8ce5a
commit
3c425edc3c
|
@ -470,6 +470,7 @@ class Course < ActiveRecord::Base
|
|||
if !code || code.size <5
|
||||
code = CODES.sample(5).join
|
||||
return generate_invite_code if Course.where(invite_code: code).present?
|
||||
self[:invite_code] = code
|
||||
save! && reload
|
||||
end
|
||||
code
|
||||
|
|
Loading…
Reference in New Issue