2015-09-23 10:02:01 +02:00
|
|
|
class User < ActiveRecord::Base
|
|
|
|
# Include default devise modules. Others available are:
|
|
|
|
# :confirmable, :lockable, :timeoutable and :omniauthable
|
|
|
|
devise :database_authenticatable, :registerable,
|
|
|
|
:recoverable, :rememberable, :trackable, :validatable
|
2015-09-23 12:16:21 +02:00
|
|
|
|
|
|
|
has_many :dossiers
|
2015-10-06 11:21:20 +02:00
|
|
|
|
|
|
|
def self.find_for_france_connect email
|
|
|
|
user = User.find_by_email(email)
|
|
|
|
|
|
|
|
return user unless user.nil?
|
|
|
|
|
|
|
|
User.create(email: email, password: Devise.friendly_token[0,20])
|
|
|
|
end
|
2015-09-23 10:02:01 +02:00
|
|
|
end
|