Permalink
Browse files

Move password email delivery to private method

* The password email delivery can now be overridden
  • Loading branch information...
salbertson committed Feb 22, 2013
1 parent c4b9acf commit b7dda29cc182d4530dc27d1a5b23c09eac01c588
Showing with 5 additions and 1 deletion.
  1. +5 −1 app/controllers/clearance/passwords_controller.rb
@@ -10,7 +10,7 @@ class Clearance::PasswordsController < ApplicationController
def create
if user = find_user_for_create
user.forgot_password!
- ::ClearanceMailer.change_password(user).deliver
+ deliver_email(user)
end
render :template => 'passwords/create'
end
@@ -38,6 +38,10 @@ def update
private
+ def deliver_email(user)
+ ::ClearanceMailer.change_password(user).deliver
+ end
+
def password_reset_params
if params.has_key? :user
ActiveSupport::Deprecation.warn %{Since locales functionality was added, accessing params[:user] is no longer supported.}

0 comments on commit b7dda29

Please sign in to comment.