Skip to content
Snippets Groups Projects
Commit 2a62e700 authored by ArtOfCode-'s avatar ArtOfCode-
Browse files

Add confirmable emails

parent 2d121b4a
Branches
Tags
No related merge requests found
......@@ -3,7 +3,7 @@
class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
devise :database_authenticatable, :registerable, :confirmable,
:recoverable, :rememberable, :trackable, :validatable
has_many :posts, dependent: :destroy
......
......
class AddConfirmableToDevise < ActiveRecord::Migration[5.2]
def up
add_column :users, :confirmation_token, :string
add_column :users, :confirmed_at, :datetime
add_column :users, :confirmation_sent_at, :datetime
add_column :users, :unconfirmed_email, :string
add_index :users, :confirmation_token, unique: true
User.update_all confirmed_at: DateTime.now
end
def down
remove_columns :users, :confirmation_token, :confirmed_at, :confirmation_sent_at
remove_columns :users, :unconfirmed_email
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_05_16_162625) do
ActiveRecord::Schema.define(version: 2020_05_17_105207) do
create_table "active_storage_attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", force: :cascade do |t|
t.string "name", null: false
......@@ -354,6 +354,11 @@ ActiveRecord::Schema.define(version: 2020_05_16_162625) do
t.datetime "login_token_expires_at"
t.string "two_factor_token"
t.boolean "enabled_2fa", default: false
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "unconfirmed_email"
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
t.index ["username"], name: "index_users_on_username"
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment