plataformatec/devise — pull request #1919 by TimothyKlim (2012-06-14 05:24:13+00:00)
Title: Fix when you model have different value for to_key

Hi!

I have very strange bug. For example:
I have a User model:
```lang=ruby
...
def slug_url
self.slug.presence || self.id.to_s
end

def to_key
[slug_url]
end
...
```
and users.slug is a string with unique profile url. When user have fill slug he don't have ability to sign in. After sign in, devise redirecting to root_path without authentication.

Or maybe I use something from bad patterns?

Thank you.