Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- User.create(:first_name => "vidur", :last_name => "punj").confirm!.skip_confirmation!
- user = User.new(:first_name => "blah")
- user.skip_confirmation!
- user.save
- user = User.new(:first_name => "vidur", :last_name => "punj")
- user.skip_confirmation!
- user.save!
- Got the solution:
- @user=User.new(:first_name => "vidur", :last_name => "punj")
- @user.skip_confirmation!
- @user.confirm!
- @user.save
- User.create!(confirmed_at: Time.now, email: 'test@example.com', ...)
- User.create_with(name: "Mr T", company: "Comp X", password: 'rubyrubyruby', password_confirmation: 'rubyrubyruby', confirmed_at: Time.now).find_or_create_by!( email: 'test@example.com')
- before_create :my_method
- def my_method
- self.skip_confirmation!
- end
- user = User.new(:first_name => "Gagan")
- user.save
Add Comment
Please, Sign In to add comment