I followed this tutorial on adding custom fields to my Devise User model, and everything seems to be working fine for the most part. However, on occasion I receive an error when I try to sign out of my application that reads like this:

NameError in Devise::SessionsController#New

uninitialized constant User::ParameterSanitizer

Extracted source (around line #11):

9 def devise_parameter_sanitizer 10 if resource_class == User 11 User::ParameterSanitizer.new(User, :user, params) 12 else 13 super 14 end

As I mentioned, my application generally works fine. Sometimes I am able to logout without receiving this error. It simply baffles me!

EDIT: Re-starting the rails server causes the error message to dissipate, however, I was looking for a more permanent solution.

EDIT: Full stack trace: