Warn in case you are using the previous session schema, closes #386

This commit is contained in:
José Valim
2010-07-19 00:11:51 +02:00
parent 869c658e3b
commit abfd7e5a4b

View File

@@ -20,6 +20,13 @@ class Warden::SessionSerializer
def deserialize(keys)
klass, id = keys
if klass.is_a?(Class)
raise "Devise changed how it stores objects in session. If you are seeing this message, " <<
"you can fix it by changing one character in your cookie secret, forcing all previous " <<
"cookies to expire, or cleaning up your database sessions if you are using a db store."
end
klass.constantize.find(:first, :conditions => { :id => id })
rescue NameError => e
if e.message =~ /uninitialized constant/