class User < ActiveRecord::Base
include BCrypt
def password
@password ||= Password.new(password_hash)
end
def password=(new_password)
@password = Password.create(new_password)
self.password_hash = @password
end
end
Here is auto_hash
class User < ActiveRecord::Base
auto_hash :password
end
Here is bcrypt-ruby
Here is auto_hash