Skip to content

Instantly share code, notes, and snippets.

@tomash
Created February 28, 2011 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tomash/847299 to your computer and use it in GitHub Desktop.
Save tomash/847299 to your computer and use it in GitHub Desktop.
override method for devise password recovery
# fails after one call even when not doing anything invasive at all:
Devise::PasswordsController.class_eval do
# POST /resource/password
def create
# email is not unique, so iterate amongst all the users
resource_class.where(:email => params[resource_name][:email]).all.each do |res|
logger.info res.username
end
redirect_to new_session_path(resource_name)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment