Class: Kuroko2::User
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Kuroko2::User
- Includes:
- TableNameCustomizable
- Defined in:
- app/models/kuroko2/user.rb
Constant Summary collapse
- GRAVATAR_URL =
'//www.gravatar.com/avatar/%s?s=90&d=mm'
- GOOGLE_OAUTH2_PROVIDER =
'google_oauth2'
- GROUP_PROVIDER =
'group_mail'
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.find_or_create_user(uid, attributes) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'app/models/kuroko2/user.rb', line 27 def self.find_or_create_user(uid, attributes) find_or_create_by(uid: uid) do |user| user.name = attributes[:name] user.email = attributes[:email] user.first_name = attributes[:first_name] user.last_name = attributes[:last_name] end end |
Instance Method Details
#google_account? ⇒ Boolean
36 37 38 |
# File 'app/models/kuroko2/user.rb', line 36 def google_account? self.provider == GOOGLE_OAUTH2_PROVIDER end |