Devise - create confirmed user account without sending out an email?
Devise - create confirmed user account without sending out an email?

So you integrated devise in your app and need your email signups to confirm. You setup devise and enabled confirmable module and things were going great.
One day your manager comes to you all excited about having social logins(Facebook, twitter, linkedin) and you no longer need them to confirm. Or it may be that your application now has email invitation feature and it would be stupid to ask the user you just invited via email to confirm their email.
It is now time to skip confirmation mail.
For this you will have to detect the mechanism by which user is being created and If it is among above two cases you can add one more line user.skip_confirmation! before saving the user.
user = User.new(user_attrs)
user.skip_confirmation!
user.save!Did this work for you? Do you have some more edge case related to this? Feel free to share in the comments below.
Happy Coding!
Reference: https://stackoverflow.com/a/7465664/4096120
Keep reading

Fix mise GitHub Rate Limit with a Token
mise makes unauthenticated GitHub API calls by default. When you hit the rate limit installing tools, a personal access token (no scopes required) fixes it permanently.

How to solve Deployment Failure-`assets:precompile`
I was trying to deploy rails 6 app on ec2 server using capistrano when precompile failure lead to whole deploymentt failure. I had to uninstall cmdtest and install yarn

How to Sort an Array of Objects in JavaScript
How to Sort an Array of Objects in JavaScript

What did you take away?
Thoughts, pushback, or a story of your own? Drop a reply below — I read every one.
Comments are powered by Disqus. By posting you agree to theirterms.