2013-06-20 147 views
0

我需要覆蓋devise/lib/devise/models/authenticatable.rb中的downcase_keys方法: see忽略設計downcase_keys方法

所以我在我的Rails應用程序的初始化它確實是:

module Devise 
module Models 

    module Authenticatable 

    protected 
    def downcase_keys 
    puts "foo" 
    super 
    end 

end 
end 

但這overrided方法不會被調用時(應該)。

任何線索?

謝謝。

+2

你重新啓動了服務器嗎? – Matt

+0

當然馬特:) – ethd

+0

不想光顧,你會驚訝多久就是這個問題:D – Matt

回答

0

好的,這種方法現在受到保護: issue

基本上我需要做到這一點,以壓倒用戶的電子郵件域,但不是前綴。 現在我剛剛在我的用戶管理器代碼中添加了一條before_save行,該行調用了執行該工作的方法,並從config.case_insensitive_keys刪除了:email

我也不得不重構一些代碼我的overrided find_for_authentication函數。