Minor changes to make it work with email instead of login method on rails 3.1