plataformatec/devise — pull request #2683 by JKDharvest (2013-10-13 18:33:02+00:00)
Title: Updated the confirmable.rb module so that :skip_confirmation_notification, when invoked, will no longer generate a confirmation token before sending a confirmation email

Previously, when ```resource.skip_confirmation_notification``` was invoked (either after ```resource = Resource.new``` and before ```resource.save```, or via a ```before_create :skip_confirmation_notification``` callback), a ```confirmation_token``` was still generated on resource creation, and thus the ```confirmation_sent_at``` attribute would be filled.

This commit adds a condition to the ```before_create :generate_confirmation_token``` callback, such that the token is only generated if ```:confirmation_required? && :send_confirmation_notification?```. Tests have also been added for the feature, ensuring that ```confirmation_token``` and ```confirmation_sent_at``` are ```nil``` after creation if ```:skip_confirmation_notification``` has been invoked