Skip to content

Commit

Permalink
Allow model configuration to be set to nil.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Oct 29, 2009
1 parent 5172d50 commit eb4437a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.rdoc
Expand Up @@ -5,6 +5,7 @@

* bug fix
* Do not redirect on invalid authenticate
* Allow model configuration to be set to nil

== 0.2.2

Expand Down
4 changes: 3 additions & 1 deletion lib/devise.rb
Expand Up @@ -38,7 +38,9 @@ def #{accessor}

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}
Expand Down

0 comments on commit eb4437a

Please sign in to comment.