2018-08-02 00:09:29 +02:00
|
|
|
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Jeremy Lecour <jlecour@evolix.fr>, 2018 Evolix <info@evolix.fr>
|
|
|
|
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
|
|
|
|
2018-05-23 17:59:28 +02:00
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: users
|
|
|
|
#
|
|
|
|
# id :bigint(8) not null, primary key
|
|
|
|
# confirmation_sent_at :datetime
|
|
|
|
# confirmation_token :string(255)
|
|
|
|
# confirmed_at :datetime
|
|
|
|
# current_sign_in_at :datetime
|
|
|
|
# current_sign_in_ip :string(255)
|
|
|
|
# email :string(255) default(""), not null
|
|
|
|
# encrypted_password :string(255) default(""), not null
|
|
|
|
# last_sign_in_at :datetime
|
|
|
|
# last_sign_in_ip :string(255)
|
2018-06-13 08:14:33 +02:00
|
|
|
# locale :string(5) default("en"), not null
|
2018-05-24 23:40:23 +02:00
|
|
|
# notifications_enabled :boolean default(TRUE), not null
|
2018-05-23 17:59:28 +02:00
|
|
|
# remember_created_at :datetime
|
|
|
|
# reset_password_sent_at :datetime
|
|
|
|
# reset_password_token :string(255)
|
|
|
|
# sign_in_count :integer default(0), not null
|
2018-05-24 23:40:23 +02:00
|
|
|
# tos_accepted :boolean default(FALSE), not null
|
2018-05-23 17:59:28 +02:00
|
|
|
# unconfirmed_email :string(255)
|
|
|
|
# created_at :datetime not null
|
|
|
|
# updated_at :datetime not null
|
|
|
|
#
|
|
|
|
# Indexes
|
|
|
|
#
|
|
|
|
# index_users_on_confirmation_token (confirmation_token) UNIQUE
|
|
|
|
# index_users_on_email (email) UNIQUE
|
|
|
|
# index_users_on_reset_password_token (reset_password_token) UNIQUE
|
|
|
|
#
|
2018-06-13 08:14:33 +02:00
|
|
|
|
2018-06-02 14:45:15 +02:00
|
|
|
require "securerandom"
|
2018-05-23 17:59:28 +02:00
|
|
|
|
2018-06-02 14:45:15 +02:00
|
|
|
FactoryBot.define do
|
|
|
|
factory :user do
|
2018-06-04 14:06:37 +02:00
|
|
|
sequence(:email) { |n| "user-#{n}@chexpire.org" }
|
2019-03-02 17:50:37 +01:00
|
|
|
password { "password" }
|
|
|
|
confirmed_at { Time.new(2018, 4, 1, 12, 0, 0, "+02:00") }
|
|
|
|
notifications_enabled { true }
|
|
|
|
locale { "en" }
|
|
|
|
tos_accepted { true }
|
2018-08-01 17:06:20 +02:00
|
|
|
|
|
|
|
trait :fr do
|
2019-03-02 17:50:37 +01:00
|
|
|
locale { "fr" }
|
2018-08-01 17:06:20 +02:00
|
|
|
end
|
2018-06-02 14:45:15 +02:00
|
|
|
end
|
|
|
|
end
|