Я внедрил систему аутентификации с помощью authlogic и добавил функцию сброса пароля в соответствии с этим руководством http://github.com/rejeep/authlogic-password-reset-tutorial
Все работает, но я не понимаю, почему это так.
Есть этот код..
class User < ActiveRecord::Base
def deliver_password_reset_instructions!
reset_perishable_token!
Notifier.deliver_password_reset_instructions(self)
end
end
и это
class Notifier < ActionMailer::Base
def password_reset_instructions(user)
subject "Password Reset Instructions"
from "[email protected]"
recipients user.email
content_type "text/html"
sent_on Time.now
body :edit_password_reset_url => edit_password_reset_url(user.perishable_token)
end
end
Меня смущает эта строчка
Notifier.deliver_password_reset_instructions(self)
как вызывается метод в классе Notifier
password_reset_instructions
без бита deliver_
.
Так что здесь происходит? как это все работает?