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 538B

12345678910111213
  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_secure_password
  10. end