Commit c08f19f275182a24fa675c31d630126c75b50af9

Authored by Dmitriy Zaporozhets
1 parent f2cac135

email validation added

Showing 1 changed file with 1 additions and 0 deletions   Show diff stats
app/models/user.rb
... ... @@ -70,6 +70,7 @@ class User < ActiveRecord::Base
70 70 has_many :team_projects, through: :user_team_project_relationships
71 71  
72 72 validates :name, presence: true
  73 + validates :email, presence: true, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/ }
73 74 validates :bio, length: { within: 0..255 }
74 75 validates :extern_uid, allow_blank: true, uniqueness: {scope: :provider}
75 76 validates :projects_limit, presence: true, numericality: {greater_than_or_equal_to: 0}
... ...