Allow model configuration to be set to nil.

This commit is contained in:
José Valim 2009-10-29 08:31:14 -02:00
parent 5172d50b95
commit eb4437adaf
2 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@
* bug fix
* Do not redirect on invalid authenticate
* Allow model configuration to be set to nil
== 0.2.2

View File

@ -38,7 +38,9 @@ module Devise
mod.const_get(:ClassMethods).class_eval <<-METHOD, __FILE__, __LINE__
def #{accessor}
@#{accessor} || if superclass.respond_to?(:#{accessor})
if defined?(@#{accessor})
@#{accessor}
elsif superclass.respond_to?(:#{accessor})
superclass.#{accessor}
else
Devise.#{accessor}