123456789101112131415 |
- class User < ApplicationRecord
- validates :email, uniqueness: true, presence: true, :on => :create
- validates :username, uniqueness: true, presence: true, :on => :create
- validates :email, format:{ with: /\S+@\S+[.]\S+/, message: "Must be a valid email format." }
- validates :password_digest, presence: true
-
- has_many :created_activities, foreign_key: 'author_id', class_name: 'Activity', dependent: :destroy
-
- has_many :joined_user_activities
- has_many :activities, :through => :joined_user_activities
-
- has_many :tasks
-
- has_secure_password
- end
|