User email confirmation is now optional

This commit is contained in:
riggraz
2019-09-23 15:52:00 +02:00
parent 10f73d876e
commit eed2ef5446
3 changed files with 10 additions and 3 deletions

View File

@@ -3,4 +3,6 @@ ENVIRONMENT=development
POSTGRES_USER=yourusernamehere POSTGRES_USER=yourusernamehere
POSTGRES_PASSWORD=yourpasswordhere POSTGRES_PASSWORD=yourpasswordhere
APP_NAME="You App Name Here" APP_NAME="You App Name Here"
EMAIL_CONFIRMATION=0

View File

@@ -1,7 +1,8 @@
class User < ApplicationRecord class User < ApplicationRecord
devise :database_authenticatable, :registerable, devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable, :recoverable, :rememberable, :validatable
:confirmable
self.send(:devise, :confirmable) if Rails.application.email_confirmation?
has_many :comments has_many :comments

View File

@@ -19,5 +19,9 @@ module App
def name def name
ENV["APP_NAME"] ENV["APP_NAME"]
end end
def email_confirmation?
ENV["EMAIL_CONFIRMATION"] == "1"
end
end end
end end