Disable Devise's :Confirmable On-The-Fly to Batch-Generate Users

Disable devise's :confirmable on-the-fly to batch-generate users

Solution by Wayne Conrad:

user = User.new
user.skip_confirmation!

http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Confirmable#skip_confirmation!-instance_method

Remove an argument from a Ruby method call at the root of a class. On-the-fly

devise :confirmable adds a number of methods to your model, one of which is skip_confirmation!:

If you don’t want confirmation to be sent on create, neither a code to
be generated, call skip_confirmation!

Example:

  user = User.new
user.skip_confirmation!

Remove an argument from a Ruby method call at the root of a class. On-the-fly

devise :confirmable adds a number of methods to your model, one of which is skip_confirmation!:

If you don’t want confirmation to be sent on create, neither a code to
be generated, call skip_confirmation!

Example:

  user = User.new
user.skip_confirmation!

Rails error : undefined method `product' for #User:0x00007faaa8c42700 Did you mean? products products=

You have left behind an old validation in your user model.

Delete this line in the app/models/user.rb file
validates_length_of :product, maximum: 10

In Production mode on Heroku Devise's conforming mail can't send

Hey Thanks a lots to @Rich Peck and @Mandeep for there efforts. I have solved the issue now.. by putting more effort on searching. I have just added one line and it works..

config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: 'gmail.com',
user_name: 'mygmail_id@gmail.com',
password: 'mygmail_password',
authentication: 'plain',
enable_starttls_auto: true,
:openssl_verify_mode => 'none' # This line added and it works fine
}


Related Topics



Leave a reply



Submit