Better handling of previously enabled Devise model deserialization #1805

Merged
merged 1 commit into from May 2, 2012

Projects

None yet

3 participants

@rosenfeld
Contributor

See issue #1800

This pull request passes (merged 6c943c79 into 3752981).

@josevalim josevalim commented on the diff May 2, 2012
lib/devise/rails/warden_compat.rb
begin
- ActiveSupport::Inflector.constantize(klass).serialize_from_session(*args)
+ klass = ActiveSupport::Inflector.constantize(klass_name)
+ if klass.respond_to? :serialize_from_session
+ klass.serialize_from_session(*args)
+ else
+ Rails.logger.warn "[Devise] Stored serialized class #{klass_name} seems not to be Devise enabled anymore. Did you do that on purpose?"
josevalim
josevalim May 2, 2012 Owner

We should return nil here.

Contributor

Good catch, I've rebased it against master and committed --amend with the nil return value fix

@josevalim josevalim merged commit 67f2074 into plataformatec:master May 2, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment