binarylogic/authlogic — pull request #290 by brianviveiros (2011-11-25 01:56:20+00:00)
Title: Raise an exception if database connection is not established before using acts_as_authentic

This would have helped us resolve an issue that took quite a while to debug because we didn't receive a meaningful exception message.

We are using Authlogic in a Sinatra based app and were including the model that uses acts_as_authentic before we established the database connection. Currently, instead of raising an exception the acts_as_authentic method just returns without error. A few lines later when we called:

```ruby
if user.valid_password?(password)
```
which resulted in the exception:

*undefined method `valid_password?' for #<User:0x007fd29dd269b0>*

since the model wasn't initialized with the Authlogic modules.