diff --git a/app/models/customer.rb b/app/models/customer.rb index 047dcb0c04..3dbdd59a67 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -1,2 +1,8 @@ class Customer < ActiveRecord::Base + + belongs_to :enterprise + + validates :code, presence: true, uniqueness: {scope: :enterprise_id} + validates :email, presence: true + validates :enterprise_id, presence: true end