mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Updating Customer model with validations
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user