Commit 0fcb54eb by Đường Sỹ Hoàng

Fixed identation self.email method

parent bba05e1e
class User < ApplicationRecord
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, presence: true, length: { maximum: 255 }, format: { with: VALID_EMAIL_REGEX }
validates :name, presence: true, length: { maximum: 50 }, uniqueness: { case_sensitive: false }
validates :password, presence: true, length: { minimum: 6 }
validates :email, presence: true, length: { maximum: 255 }, format: { with: VALID_EMAIL_REGEX }
validates :name, presence: true, length: { maximum: 50 }, uniqueness: { case_sensitive: false }
validates :password, presence: true, length: { minimum: 6 }
before_save { self.email = email.downcase! }
before_save { email.downcase! }
has_secure_password
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment