1
0
Fork 0
This repository has been archived on 2023-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/models/user.rb

26 lines
436 B
Ruby
Raw Normal View History

2018-11-29 20:57:57 +00:00
# frozen_string_literal: true
class User < ApplicationRecord
devise(
2018-12-03 17:58:39 +00:00
:confirmable,
2018-11-29 20:57:57 +00:00
:database_authenticatable,
2018-12-03 20:19:41 +00:00
:lockable,
:omniauthable,
2018-12-03 20:03:01 +00:00
:recoverable,
2018-11-29 20:57:57 +00:00
:registerable,
:rememberable,
2018-12-04 02:12:07 +00:00
:timeoutable,
2018-11-29 20:57:57 +00:00
:trackable,
:validatable,
omniauth_providers: %i[github],
2018-11-29 20:57:57 +00:00
)
2018-12-02 02:50:10 +00:00
belongs_to :account
validates :account_id, uniqueness: true
before_validation do
self.account ||= Account.new
end
2018-11-29 20:57:57 +00:00
end