ectomobile/app/models/user.rb

13 lines
507 B
Ruby
Raw Permalink Normal View History

2021-07-26 18:09:47 +00:00
class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
2022-06-11 16:11:50 +00:00
devise :database_authenticatable,
2021-07-26 18:09:47 +00:00
:recoverable, :rememberable, :validatable, :lockable, :timeoutable
2022-06-11 16:11:50 +00:00
# Trazabilidad
#
# @see {https://guides.rubyonrails.org/association_basics.html#self-joins}
belongs_to :created_by, class_name: 'User', optional: true
has_many :created, class_name: 'User', foreign_key: 'created_by_id'
2021-07-26 18:09:47 +00:00
end