API de comptabilité horaire.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

user.rb 557B

123456789101112131415
  1. class User < ApplicationRecord
  2. validates :email, uniqueness: true, presence: true, :on => :create
  3. validates :username, uniqueness: true, presence: true, :on => :create
  4. validates :email, format:{ with: /\S+@\S+[.]\S+/, message: "Must be a valid email format." }
  5. validates :password_digest, presence: true
  6. has_many :created_activities, foreign_key: 'author_id', class_name: 'Activity', dependent: :destroy
  7. has_many :joined_user_activities
  8. has_many :activities, :through => :joined_user_activities
  9. has_many :tasks
  10. has_secure_password
  11. end