簡體   English   中英

覆蓋active_for_authentication? 為了設計

[英]Override active_for_authentication? for devise

我在哪里用它來覆蓋active_for_authentication?

def active_for_authentication?
  super && account_active?
end

1)文件和文件名的位置。

2)完整文件的樣子......等等...類<<< devise:something

原來的active_for_authentication? 方法可以在devise / lib / devise / models / authenticatable.rb中找到。

謝謝

覆蓋active_for_authentication? 模型中的方法[...] - 來源

因此,如果您有用戶模型,則只需要執行此操作

class User

  def active_for_authentication?
    super && account_active?
  end

end

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM