Add coitem MVC
[cs356-p2-videostore.git] / app / models / customer.rb
1 class Customer < ActiveRecord::Base
2   belongs_to :coitem # FIXME: I hunch this is wrong
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