gpt4 book ai didi

ruby-on-rails - 配置设计允许多个帐户使用相同的电子邮件

转载 作者:行者123 更新时间:2023-12-04 00:36:14 27 4
gpt4 key购买 nike

我们有用户想要为多个帐户使用相同的电子邮件地址。我们的 rails 应用程序使用 omniauth-twitter gem 和 Devise 来验证用户。用户注册时,需要电子邮件,但不用于身份验证。

我们如何配置 Devise 以允许用户在注册多个帐户时使用相同的电子邮件而不会收到“电子邮件已被占用”验证错误?

最佳答案

您可以简单地从模型设计选项中删除 :validatable 。

Validatable creates all needed validations for a user email and password. It's optional, given you may want to create the validations by yourself. Automatically validate if the email is present, unique and its format is valid. Also tests presence of password, confirmation and length.



http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Validatable

关于ruby-on-rails - 配置设计允许多个帐户使用相同的电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24250143/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com