API de comptabilité horaire.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718
  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, foreign_key: 'owner_id', class_name: 'Task', dependent: :destroy
  10. has_many :memberships, foreign_key: :member_id, dependent: :destroy
  11. has_many :teams, through: :memberships
  12. has_secure_password
  13. end