In the apps I’ve been working on recently I decided to utilize rails built in authentication ‘has_secure_password’ which began shipping with Rails 3.1. Has_secure_password is simple to use and doesn’t bring in any extra bulk. With some of these projects I also decided to use MongoDB & Mongoid. When trying to use the has_secure_password method I got:

  undefined local variable or method `has_secure_password' for User:Class (NameError)

Solution: You must include include ActiveModel::SecurePassword.