I implemented an authentication system using authlogic, and have added password reset functionality as per this tutorial http://github.com/rejeep/authlogic-password-reset-tutorial
It all works, but I am confused as to why it does..
There is this code..
class User < ActiveRecord::Base
def deliver_password_reset_instructions!
reset_perishable_token!
Notifier.deliver_password_reset_instructions(self)
end
end
and this
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
This line confuses me
Notifier.deliver_password_reset_instructions(self)
as the method in the Notifier class is called
password_reset_instructions
without the deliver_
bit.
So whats going on here? how come it all works?