alphagov/signonotron2 — pull request #35 by jamiecobbett (2012-12-04 10:44:30+00:00)
Title: Fixing password reset for existing users

devise_invitable #invite! calls #skip_confirmation!, which in turn sets confirmed_at to Time.now.utc.
That means that when the user accepts the invitation, they are already "confirmed", and everything works.

However, because we didn't have confirmable enabled (nor the columns on the user table), that had no effect.
Now that we've added confirmable (and the columns on the user table), the behaviour of things like
password resets for those existing users breaks because Devise assumes confirmed_at (or confirmation_sent_at)
is set.

So to make the old users look like users created now, those users need to have confirmed_at set.

Removing the hack in the User model because, whilst that addressed some problems, it was based upon a false understanding.