fix customer validation
This commit is contained in:
@@ -9,8 +9,8 @@ class Customer < ApplicationRecord
|
||||
has_many :orders
|
||||
has_many :sales
|
||||
|
||||
validates_presence_of :name, :contact_no #,:card_no
|
||||
validates :contact_no, numericality: true #uniqueness: true,
|
||||
validates_presence_of :name #, :contact_no #,:card_no
|
||||
validates :contact_no, numericality: true, uniqueness: { scope: :shop_code }, allow_blank: true
|
||||
validates :email, presence: true, uniqueness: { scope: :shop_code }, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, on: :create }, allow_blank: true
|
||||
# validates :card_no, uniqueness: true
|
||||
# validates :paypar_account_no, uniqueness: true
|
||||
|
||||
Reference in New Issue
Block a user