Devise gem skip confirmation and skip confirmation via email both at once

devise, ruby-on-rails, ruby-on-rails-3, rubygems

Solution

You need to call skip_confirmation! before you save the record.

Try

user = User.new(:first_name => "blah")
user.skip_confirmation!
user.save

Problem

I am using devise gem and while creating user I want to skip confimation! and skip confimation email for example: ``` User.create(:first_name => "vidur", :last_name => "punj").confirm!.skip_confirmation! ``` But it skips only confirmation and doesn't skip sending confirmation email. Can any one give me an idea to skip both.

Original source