【发布时间】:2017-05-31 00:46:38
【问题描述】:
基于initializers/devise.rb 中的以下配置:
# Configure which authentication keys should be case-insensitive.
# These keys will be downcased upon creating or modifying a user and when used
# to authenticate or find a user. Default is :email.
config.case_insensitive_keys = [:email]
“找到用户”是什么意思?是不是在做的时候:
User.find_by(email: "UsEr@ExampLe.com")
因为当我在数据库中有一个电子邮件为"user@example.com" 的用户时,这不起作用并返回 nil。
我正在使用 rails 5 和 Devise 4.2.0
【问题讨论】:
标签: ruby-on-rails email devise ruby-on-rails-5