projects
/
cs356-p2-videostore.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
1a86679c408058700a2bcbd098ee8c21f92312d7
[cs356-p2-videostore.git]
/
app
/
models
/
customer.rb
1
class Customer < ActiveRecord::Base
2
has_many :coitem
3
4
validates_presence_of :name, :email, :phone, :address
5
validates_numericality_of :debt
6
7
protected
8
9
def validate
10
errors.add(:debt, "should be non-negative") if debt.nil? || debt < 0.00
11
end
12
13
end