Merge 72c4e9f24c into 80a9544279
This commit is contained in:
commit
8c967a9f6b
1 changed files with 2 additions and 1 deletions
|
|
@ -64,7 +64,8 @@ class User < ActiveRecord::Base
|
||||||
scope :admin, -> { where(is_admin: true) }
|
scope :admin, -> { where(is_admin: true) }
|
||||||
scope :active, -> { where(is_disabled: false) }
|
scope :active, -> { where(is_disabled: false) }
|
||||||
|
|
||||||
validates :email, presence: true
|
VALID_EMAIL_REGEX = /\A([\w+\-].?)+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/i
|
||||||
|
validates :email, presence: true, format: {with: VALID_EMAIL_REGEX }
|
||||||
|
|
||||||
validates :username,
|
validates :username,
|
||||||
uniqueness: {
|
uniqueness: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue