Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6577495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:38:38+00:00 2026-05-25T15:38:38+00:00

I integrated devise with facebook. Now when I create a user account after the

  • 0

I integrated devise with facebook. Now when I create a user account after the user has logged in with his/her facebook account,

  user = User.create(:email => data["email"], 
                     :password => Devise.friendly_token[0,20]) 
  user.confirmed_at = DateTime.now
  user.save!

even though the account has been confirmed, an confirmation email is still fired. Any idea how I can turn the email firing off?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:38:39+00:00Added an answer on May 25, 2026 at 3:38 pm

    The confirm callback happens after create, so it’s happening on line 1 of your example, before you set confirmed_at manually.

    As per the comments, the most correct thing to do would be to use the method provided for this purpose, #skip_confirmation!. Setting confirmed_at manually will work, but it circumvents the provided API, which is something which should be avoided when possible.

    So, something like:

    user = User.new(user_attrs)
    user.skip_confirmation!
    user.save!
    

    Original answer:

    If you pass the confirmed_at along with your create arguments, the mail should not be sent, as the test of whether or not an account is already “confirmed” is to look at whether or not that date is set.

    User.create(
      :email => data['email'], 
      :password => Devise.friendly_token[0,20], 
      :confirmed_at => DateTime.now
    )
    

    That, or just use new instead of create to build your user record.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Language Integrated Query. Now I know that the acronyms are. I have seen C#
The integrated Web Deployment in Visual Studio 2010 is pretty nice. It can create
I have integrated the facebook in my app using http://sourceforge.net/projects/facebook-bb-sdk , it work fine
Problem I'm trying to create an CUDA application that is well integrated with .net.
I integrated facebook app using sharekit by giving the FB Secret key and session
I have a Rails 3 application using Devise for authentication. Now I need to
I have a Rails app with devise integrated. I'm using the Cookie Store session.
I have a download manager integrated into my iPhone App which allows the user
Having integrated merb_auth_password_slice as per the README, I can successfully login as redirect_after_login is
With integrated pipeline, all requests are passed through ASP.NET, including images, CSS. Whereas, in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.