1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-20 13:49:39 +02:00
Maybe/app/models/user.rb

14 lines
335 B
Ruby
Raw Normal View History

2024-02-02 09:05:04 -06:00
class User < ApplicationRecord
has_secure_password
2024-02-02 09:05:04 -06:00
belongs_to :family
accepts_nested_attributes_for :family
2024-02-02 09:05:04 -06:00
validates :email, presence: true, uniqueness: true
normalizes :email, with: ->(email) { email.strip.downcase }
2024-02-02 09:05:04 -06:00
generates_token_for :password_reset, expires_in: 15.minutes do
password_salt&.last(10)
end
end