added suppliers, weight to item
This commit is contained in:
10
back-office/app/models/user.rb
Normal file
10
back-office/app/models/user.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class User < ActiveRecord::Base
|
||||
has_many :carts
|
||||
|
||||
validates_presence_of :first_name, :last_name, :password, :email, :password_confirmation
|
||||
|
||||
validates :email, :uniqueness => {:case_sensitive => false, :message => "Email already exists!"},
|
||||
format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, message: "invalid email" }
|
||||
|
||||
validates :password, confirmation: true, length: { in:6..20, too_short: 'password needs to be at least 6 characters long' }
|
||||
end
|
||||
Reference in New Issue
Block a user