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.

123456789
  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_secure_password
  8. end