1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/models/user.rb
2019-03-24 06:42:27 +05:00

27 lines
498 B
Ruby

# frozen_string_literal: true
class User < ApplicationRecord
devise(
:confirmable,
:database_authenticatable,
:lockable,
:omniauthable,
:recoverable,
:registerable,
:rememberable,
:timeoutable,
:trackable,
:validatable,
omniauth_providers: %i[github],
)
belongs_to :account
has_many :user_omniauths, dependent: :restrict_with_exception
validates :account, uniqueness: true
before_validation do
self.account ||= Account.new
end
end