updated for rails 4 and latest version of devise