Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

延迟注册问题 #16

Closed
hymRedemption opened this issue Feb 25, 2016 · 0 comments
Closed

延迟注册问题 #16

hymRedemption opened this issue Feb 25, 2016 · 0 comments

Comments

@hymRedemption
Copy link
Collaborator

现有延迟注册

现在延迟注册的时候,用户只提供 email 和 password 就能注册了, phone 可以是空。

有问题的地方

但是 phone 在数据库层面做了 unique,而在数据库中,两个 phone 属性都为空字符(不是 null)的数据,数据库认为是违反了 unique(虽然在 Model 中 allow_blank)。

问题现象重复方式: 通过网页注册两个都不提供 phone 属性的账号。在第一个账号不完善资料的情况下,注册第二个账号,数据库会报错

可行的解决方式

相对简单的解决办法是,后台确保 phone 为空的时候,其值应为 nil

@nobrick nobrick closed this as completed Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants