2024-11-18 23:27:50 +00:00
|
|
|
# Copyright (C) 2024 Manuel Bustillo
|
|
|
|
|
2024-11-19 00:26:44 +01:00
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: users
|
|
|
|
#
|
|
|
|
# id :bigint not null, primary key
|
|
|
|
# email_address :string not null
|
|
|
|
# password_digest :string not null
|
|
|
|
# created_at :datetime not null
|
|
|
|
# updated_at :datetime not null
|
|
|
|
#
|
|
|
|
# Indexes
|
|
|
|
#
|
|
|
|
# index_users_on_email_address (email_address) UNIQUE
|
|
|
|
#
|
|
|
|
class User < ApplicationRecord
|
|
|
|
has_secure_password
|
|
|
|
has_many :sessions, dependent: :destroy
|
|
|
|
|
|
|
|
normalizes :email_address, with: ->(e) { e.strip.downcase }
|
|
|
|
end
|