I still needed to create a token, so my code turned out to be the same. This is a quick and dirty solution, and it can be improved, but at least it shows how to do it:
user.confirmed_at = Time.now
user.save!
user.confirmed_at = nil
user.send(:generate_confirmation_token)
user.save!
source
share