Ruby on rails 覆盖设计下行键方法
我需要覆盖Ruby on rails 覆盖设计下行键方法,ruby-on-rails,ruby,devise,Ruby On Rails,Ruby,Devise,我需要覆盖designe/lib/designe/models/authenticable.rb中的downcase\u keys方法: 因此,我的Rails应用程序中有一个初始值设定项: module Devise module Models module Authenticatable protected def downcase_keys puts "foo" super end end end 但是这个被重写的方法永远不会被调用(当
designe/lib/designe/models/authenticable.rb中的downcase\u keys方法:
因此,我的Rails应用程序中有一个初始值设定项:
module Devise
module Models
module Authenticatable
protected
def downcase_keys
puts "foo"
super
end
end
end
但是这个被重写的方法永远不会被调用(当它应该被调用时)
有线索吗
谢谢。好的,此方法现在受保护:
基本上,我需要这样做,以关闭用户电子邮件域,但不是前缀。
现在,我只是在我的用户管理器代码中添加了一个之前的保存
行,该行调用了一个执行该操作的方法,我从配置中删除了:email
。不区分大小写的\u键
我还必须重构我被覆盖的find\u for\u authentication
功能的一些代码。你重启了服务器吗?如果你不想光顾,你会惊讶于这是一个多么频繁的问题:你想用这个方法做什么?