Updating Customer model with validations

This commit is contained in:
Lynne Davis
2015-03-02 12:32:28 +11:00
parent 87b1ab9a1a
commit 39c5f8febe

View File

@@ -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