mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 03:07:52 +01:00
User email confirmation is now optional
This commit is contained in:
@@ -3,4 +3,6 @@ ENVIRONMENT=development
|
||||
POSTGRES_USER=yourusernamehere
|
||||
POSTGRES_PASSWORD=yourpasswordhere
|
||||
|
||||
APP_NAME="You App Name Here"
|
||||
APP_NAME="You App Name Here"
|
||||
|
||||
EMAIL_CONFIRMATION=0
|
||||
@@ -1,7 +1,8 @@
|
||||
class User < ApplicationRecord
|
||||
devise :database_authenticatable, :registerable,
|
||||
:recoverable, :rememberable, :validatable,
|
||||
:confirmable
|
||||
:recoverable, :rememberable, :validatable
|
||||
|
||||
self.send(:devise, :confirmable) if Rails.application.email_confirmation?
|
||||
|
||||
has_many :comments
|
||||
|
||||
|
||||
@@ -19,5 +19,9 @@ module App
|
||||
def name
|
||||
ENV["APP_NAME"]
|
||||
end
|
||||
|
||||
def email_confirmation?
|
||||
ENV["EMAIL_CONFIRMATION"] == "1"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user