Modeling users
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
-
app/models/user.rb 0 → 100644
1 class User < ApplicationRecord 2 before_save { self.email = email.downcase } 3 validates :name, presence: true, length: { maximum: 50 } 4 VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i 5 validates :email, presence: true, length: { maximum: 255 }, 6 format: { with: VALID_EMAIL_REGEX }, 7 uniqueness: { case_sensitive: false } 8 has_secure_password 9 validates :password, presence: true, length: { minimum: 6 } -
Master
E đọc lại phần Rails style guide về Models: Active Record nhé. https://github.com/rubocop-hq/rails-style-guide#models-active-record Người ta có nói về thứ tự sắp xếp các methods đó. Trong sách ngta ko tuân thủ, nhưng trong dự án mình sẽ tuân thủ nha.
-
-
-
-
Toggle commit list
-
-
merged
Toggle commit list