Skip to content

Commit

Permalink
add trackable module to devise
Browse files Browse the repository at this point in the history
  • Loading branch information
fosterfarrell9 committed Nov 1, 2023
1 parent 0ff42a1 commit 9de6c35
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class User < ApplicationRecord
include ApplicationHelper

# use devise for authentification, include the following modules
devise :database_authenticatable, :registerable,
devise :database_authenticatable, :registerable, :trackable,
:recoverable, :rememberable, :validatable, :confirmable, :lockable

# a user has many subscribed lectures
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class AddDeviseTrackableColumnsToUsers < ActiveRecord::Migration[7.0]
def change
add_column :users, :sign_in_count, :integer, default: 0, null: false
add_column :users, :current_sign_in_at, :datetime
add_column :users, :last_sign_in_at, :datetime
add_column :users, :current_sign_in_ip, :string
add_column :users, :last_sign_in_ip, :string
end
end
7 changes: 6 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2023_04_27_124337) do
ActiveRecord::Schema[7.0].define(version: 2023_11_01_100015) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
Expand Down Expand Up @@ -848,6 +848,11 @@
t.datetime "locked_at", precision: nil
t.text "image_data"
t.string "ghost_hash"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
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
Expand Down

0 comments on commit 9de6c35

Please sign in to comment.