2026-05-25 16:15:06 +00:00
|
|
|
# == Schema Information
|
|
|
|
|
#
|
2026-05-30 14:54:26 +00:00
|
|
|
# Table name: users
|
2026-05-25 16:15:06 +00:00
|
|
|
#
|
|
|
|
|
# id :bigint not null, primary key
|
|
|
|
|
# email :string
|
|
|
|
|
# name :string
|
|
|
|
|
# password_digest :string
|
2026-05-30 14:54:26 +00:00
|
|
|
# role :integer
|
2026-05-25 16:15:06 +00:00
|
|
|
# created_at :datetime not null
|
|
|
|
|
# updated_at :datetime not null
|
|
|
|
|
#
|
|
|
|
|
# Indexes
|
|
|
|
|
#
|
2026-05-30 14:54:26 +00:00
|
|
|
# index_users_on_email (email) UNIQUE
|
2026-05-25 16:15:06 +00:00
|
|
|
#
|
2026-05-30 14:54:26 +00:00
|
|
|
class User < ApplicationRecord
|
2026-05-30 21:27:35 +00:00
|
|
|
has_secure_password
|
2026-05-30 14:54:26 +00:00
|
|
|
has_many :price_reports, dependent: :nullify
|
|
|
|
|
has_many :moderation_logs, foreign_key: :admin_id, dependent: :nullify
|
2026-06-09 15:59:17 +00:00
|
|
|
has_many :sessions, dependent: :destroy
|
2026-05-17 11:12:43 +00:00
|
|
|
end
|