lib/janus/controllers/passwords_controller.rb in janus-0.9.1 vs lib/janus/controllers/passwords_controller.rb in janus-0.10.0

- old
+ new

@@ -65,10 +65,11 @@ end # Simple wrapper for Mailer#reset_password_instructions.deliver to # allow customization of the email (eg: to pass additional data). def deliver_reset_password_instructions(resource) - mailer_class.reset_password_instructions(resource).deliver + mail = mailer_class.reset_password_instructions(resource) + mail.respond_to?(:deliver_later) ? mail.deliver_later : mail.deliver end # Either redirects the user to after_password_change_url or to # <tt>params[:return_to]</tt> if present. def redirect_after_password_change(resource, options = {})