0

So I have made some dummy data (mostly new users) for an app I'm working on for my capstone. I decided that sending out email conformations to a user so they can click on a link to verify their account was a pretty cool feature to add to my app. So with the help of devise and a little trolling on the internet, I was able to add the feature successfully.

Here is where I'm stuck, My dummy data consists of dummy emails, which are getting sent a confirmation email, which they obviously have to click to activate the account, so that their confirmed_at status on my postgres database changes to the time they clicked the confirmation email(which will never happen).

So it seems there is a confirmation_token that goes along with the email, and I tried a few things, obviously unsuccessful, hence the reason for the question.

  1. I tried to loop through all users in rails c and assign each user.confirmed_at = Time.now, after running this, and then put user.confirmed_at gives me the the current time on all of the confirmed_at attribute for each user but does not update on postgres and in turn I get the flash message of you must confirm your email before you can sign in , when trying to sign in.

  2. I tried to just paste info on the postgres database itself under the confirmed_at column but that does not work, cause it won't show on the rails c, or allow me to sign in.

Any tips on bypassing the confirmed_at just(other than to set up new users through console manually and skipping the confirmation part, as I already have users created and would like to use those) would be greatly appreciated. Looking forward to your response.

6
  • Have you tried using .confirm! on the User object ? Commented Aug 27, 2016 at 5:31
  • See this example here: stackoverflow.com/a/17006426/2545197 Commented Aug 27, 2016 at 5:31
  • Yes @Abhinay, when i tried confirm! on User object I get the following: undefined method `confirm!' for #<User:0x007f9e64ac8bb8> , I will however look into the link you showed. Thanks. Commented Aug 27, 2016 at 13:09
  • Also regarding the link you sent, I saw that already and it explains how to set up new users via skipping confirmation, not changing existing ones that were created in which an email was sent out. Will dig in to it a little more, but might have to install a faker gem and set up all new dummy data. Commented Aug 27, 2016 at 13:13
  • That's where .confirm comes into the picture. You can run this method on older user records to confirm. Please check if your confirmable module is working properly. Cause if it's enabled then application should not throw undefined method. Commented Aug 27, 2016 at 13:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.