0
我需要選擇何時設計發送確認郵件。我覆蓋send_confirmation_instructions並在我的用戶模型上添加一個名爲invite的日期字段。如果邀請字段爲空發送郵件,否則不發送。設計時選擇是否發送確認郵件
這裏是我的代碼:
Loading development environment (Rails 3.0.10) 1.9.3-p0 :001 > User.create!(:email => "[email protected]") NoMethodError: undefined method `reconfirmation_required?' for
我重寫很多其他色器件的方法沒有問題:
def send_confirmation_instructions
unless invited.nil?
self.confirmation_token = nil if reconfirmation_required?
@reconfirmation_required = false
generate_confirmation_token! if self.confirmation_token.blank?
else
self.confirmation_token = nil if reconfirmation_required?
@reconfirmation_required = false
generate_confirmation_token! if self.confirmation_token.blank?
self.devise_mailer.confirmation_instructions(self).deliver
end
end
我的控制檯它的輸出。任何想法 ?
在此先感謝。
重新確認的地方在哪裏?界定?如果包含試圖調用reconfirmation_required的類,整個控制檯錯誤會更有幫助嗎? – Igrabes